changeset 18549:12de53323e59 stable

rebase: derive node from target rev (issue3802) dest.rev() is the same as target when a new rebase is run, but dest isn't set when rebase --continue is run. Bug introduced in 2a1fac3650a5, which fixed issue3685.
author Siddharth Agarwal <sid0@fb.com>
date Sun, 03 Feb 2013 14:26:39 -0800
parents 151f78a07607
children db3a3a65e0db e8efcc8ff5c0
files hgext/rebase.py tests/test-rebase-bookmarks.t
diffstat 2 files changed, 37 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Fri Feb 01 15:32:05 2013 -0600
+++ b/hgext/rebase.py	Sun Feb 03 14:26:39 2013 -0800
@@ -316,6 +316,9 @@
             for k, v in state.iteritems():
                 if v > nullmerge:
                     nstate[repo[k].node()] = repo[v].node()
+            # XXX this is the same as dest.node() for the non-continue path --
+            # this should probably be cleaned up
+            targetnode = repo[target].node()
 
         if not keepf:
             collapsedas = None
@@ -324,7 +327,7 @@
             clearrebased(ui, repo, state, skipped, collapsedas)
 
         if currentbookmarks:
-            updatebookmarks(repo, dest, nstate, currentbookmarks)
+            updatebookmarks(repo, targetnode, nstate, currentbookmarks)
 
         clearstatus(repo)
         ui.note(_("rebase completed\n"))
@@ -501,15 +504,14 @@
         mq.seriesdirty = True
         mq.savedirty()
 
-def updatebookmarks(repo, dest, nstate, originalbookmarks):
+def updatebookmarks(repo, targetnode, nstate, originalbookmarks):
     'Move bookmarks to their correct changesets, and delete divergent ones'
-    destnode = dest.node()
     marks = repo._bookmarks
     for k, v in originalbookmarks.iteritems():
         if v in nstate:
             # update the bookmarks for revs that have moved
             marks[k] = nstate[v]
-            bookmarks.deletedivergent(repo, [destnode], k)
+            bookmarks.deletedivergent(repo, [targetnode], k)
 
     marks.write()
 
--- a/tests/test-rebase-bookmarks.t	Fri Feb 01 15:32:05 2013 -0600
+++ b/tests/test-rebase-bookmarks.t	Sun Feb 03 14:26:39 2013 -0800
@@ -127,5 +127,36 @@
   |
   o  0: 'A' bookmarks:
   
+rebase --continue with bookmarks present (issue3802)
+
+  $ hg up 2
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo 'C' > c
+  $ hg add c
+  $ hg ci -m 'other C'
+  created new head
+  $ hg up 3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg rebase
+  merging c
+  warning: conflicts during merge.
+  merging c incomplete! (edit conflicts, then use 'hg resolve --mark')
+  abort: unresolved conflicts (see hg resolve, then hg rebase --continue)
+  [255]
+  $ echo 'c' > c
+  $ hg resolve --mark c
+  $ hg rebase --continue
+  saved backup bundle to $TESTTMP/a3/.hg/strip-backup/3d5fa227f4b5-backup.hg (glob)
+  $ hg tglog
+  @  4: 'C' bookmarks: Y Z
+  |
+  o  3: 'other C' bookmarks:
+  |
+  o  2: 'B' bookmarks: X
+  |
+  o  1: 'D' bookmarks: W
+  |
+  o  0: 'A' bookmarks:
+  
 
   $ cd ..