Merge crew-stable into crew
authorBryan O'Sullivan <bryano@fb.com>
Mon, 04 Feb 2013 11:42:10 -0800
changeset 18550 db3a3a65e0db
parent 18548 e71c2ff93167 (current diff)
parent 18549 12de53323e59 (diff)
child 18551 d6fb7bbec16a
Merge crew-stable into crew
--- a/hgext/rebase.py	Mon Feb 04 02:46:53 2013 +0100
+++ b/hgext/rebase.py	Mon Feb 04 11:42:10 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	Mon Feb 04 02:46:53 2013 +0100
+++ b/tests/test-rebase-bookmarks.t	Mon Feb 04 11:42:10 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 ..