Bug 3619 - hg pull --rebase clash with --rev
Summary: hg pull --rebase clash with --rev
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: rebase (show other bugs)
Version: earlier
Hardware: PC Linux
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-10 12:41 UTC by Pierre-Yves David
Modified: 2017-11-01 18:05 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Yves David 2012-09-10 12:41 UTC
with a specific revision to pull is specified in addition of --rebase the rebase pick the wrong revision to rebase.

This seems to comes from rebase intercepting the --rev option for itself.


diff --git a/tests/test-rebase-pull.t b/tests/test-rebase-pull.t
--- a/tests/test-rebase-pull.t
+++ b/tests/test-rebase-pull.t
@@ -112,5 +112,59 @@ pull --rebase doesn't update if nothing 
   $ hg tglog -l 1
   o  2: 'R1'
   |
 
   $ cd ..
+
+pull rebase works with a specidig revision is pulled
+
+  $ cd a
+  $ hg tglog
+  @  2: 'R1'
+  |
+  o  1: 'C2'
+  |
+  o  0: 'C1'
+  
+  $ echo R2 > R2
+  $ hg ci -Am R2
+  adding R2
+  $ echo R3 > R3
+  $ hg ci -Am R3
+  adding R3
+  $ cd ../c
+  $ hg tglog
+  o  2: 'R1'
+  |
+  @  1: 'C2'
+  |
+  o  0: 'C1'
+  
+  $ echo L1 > L1
+  $ hg ci -Am L1
+  adding L1
+  created new head
+  $ hg pull --rev tip --rebase
+  pulling from $TESTTMP/a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  abort: can't rebase immutable changeset 770a61882ace
+  (see hg help phases for details)
+  [255]
+  $ hg tglog
+  o  5: 'R3'
+  |
+  o  4: 'R2'
+  |
+  | @  3: 'L1'
+  | |
+  o |  2: 'R1'
+  |/
+  o  1: 'C2'
+  |
+  o  0: 'C1'
+  
+
+
Comment 1 HG Bot 2012-12-03 15:31 UTC
Fixed by http://selenic.com/repo/hg/rev/848345a8d6ad
Pierre-Yves David <pierre-yves.david@logilab.fr>
rebase: fix pull --rev options clashing with --rebase (issue3619)

Rebase also have a plain `--rev` option used to select the rebase set (as
`--base` or `--source` would). But the content of the --rev option was intended
for the remote repo and is irrelevant for the local rebase operation. We expect
`hg pull --rebase` to stick with the default behavior here:

    hg rebase --base . --dest tip(branch(.))

The `rev` option is dropped from the option passed to rebase.

(please test the fix)