# HG changeset patch # User Kyle Lippincott # Date 1454695361 28800 # Fri Feb 05 10:02:41 2016 -0800 # Node ID 8bf61a5a1fc63e6e888aaafca1fb573a73197f82 # Parent 329573f3fc606ee0b524383ac70f05bd2ecab0e8 tweakdefaults: support pull --rebase -d without remotenames diff --git a/tests/test-tweakdefaults.t b/tests/test-tweakdefaults.t --- a/tests/test-tweakdefaults.t +++ b/tests/test-tweakdefaults.t @@ -417,3 +417,41 @@ HG: bookmark 'hyphen-book' HG: changed afile +Test non-remotenames use of pull --rebase and --update requires --dest + $ cd $TESTTMP + $ hg clone repo clone + updating to branch default + 9 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cd clone + $ hg pull --rebase + abort: you must use a bookmark with tracking or manually specify a destination for the rebase + (set up tracking with `hg book -t ` or manually supply --dest / -d) + [255] + $ hg pull --update + abort: you must specify a destination for the update + (use `hg pull --update --dest `) + [255] + $ echo foo > foo + $ hg commit -Am 'foo' + adding foo + $ hg pull --rebase -d default + pulling from $TESTTMP/repo (glob) + searching for changes + no changes found + nothing to rebase - working directory parent is also destination + $ hg pull --update -d default + pulling from $TESTTMP/repo (glob) + searching for changes + no changes found + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg pull --rebase --config tweakdefaults.defaultdest=default + pulling from $TESTTMP/repo (glob) + searching for changes + no changes found + nothing to rebase - working directory parent is also destination + $ hg pull --update --config tweakdefaults.defaultdest=default + pulling from $TESTTMP/repo (glob) + searching for changes + no changes found + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cd $TESTTMP/repo diff --git a/tweakdefaults.py b/tweakdefaults.py --- a/tweakdefaults.py +++ b/tweakdefaults.py @@ -142,7 +142,9 @@ rebase = opts.get('rebase') update = opts.get('update') isrebase = rebase or rebaseflag - if isrebase: + # Only use from the global rebasedest if _getrebasedest was called. If the + # user isn't using remotenames, then rebasedest isn't set. + if rebaseflag: dest = rebasedest else: dest = opts.get('dest')