diff hgext/rebase.py @ 15471:f520c9616db5

merge with stable
author Matt Mackall <mpm@selenic.com>
date Thu, 10 Nov 2011 11:00:27 -0600
parents c1eb8398fe82 ad336e093a59
children 306e84e8bbe9
line wrap: on
line diff
--- a/hgext/rebase.py	Thu Nov 10 10:59:03 2011 -0600
+++ b/hgext/rebase.py	Thu Nov 10 11:00:27 2011 -0600
@@ -213,6 +213,7 @@
                 originalwd, target, state = result
                 if collapsef:
                     targetancestors = set(repo.changelog.ancestors(target))
+                    targetancestors.add(target)
                     external = checkexternal(repo, state, targetancestors)
 
         if keepbranchesf:
@@ -477,7 +478,10 @@
     f.write('%d\n' % int(keepbranches))
     for d, v in state.iteritems():
         oldrev = repo[d].hex()
-        newrev = repo[v].hex()
+        if v != nullmerge:
+            newrev = repo[v].hex()
+        else:
+            newrev = v
         f.write("%s:%s\n" % (oldrev, newrev))
     f.close()
     repo.ui.debug('rebase status stored\n')
@@ -510,7 +514,10 @@
                 keepbranches = bool(int(l))
             else:
                 oldrev, newrev = l.split(':')
-                state[repo[oldrev].rev()] = repo[newrev].rev()
+                if newrev != str(nullmerge):
+                    state[repo[oldrev].rev()] = repo[newrev].rev()
+                else:
+                    state[repo[oldrev].rev()] = int(newrev)
         skipped = set()
         # recompute the set of skipped revs
         if not collapse: