diff hgext/rebase.py @ 31306:f5c71e98f0f7

rebase: unhide original working directory node as well (issue5219) By including the working directory revision at the start of rebase in the repo._rebaseset, we make sure it's not hidden when we update back to it at the end of the rebase. This feels like abusing the set a bit given its name (_rebaseset), but I couldn't think of another name that's clearly better.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 10 Mar 2017 23:07:20 -0800
parents 98658f73588a
children 681046de87f1
line wrap: on
line diff
--- a/hgext/rebase.py	Fri Mar 10 23:06:31 2017 -0800
+++ b/hgext/rebase.py	Fri Mar 10 23:07:20 2017 -0800
@@ -250,7 +250,7 @@
         repo.ui.debug('computed skipped revs: %s\n' %
                         (' '.join(str(r) for r in sorted(skipped)) or None))
         repo.ui.debug('rebase status resumed\n')
-        _setrebasesetvisibility(repo, set(state.keys()))
+        _setrebasesetvisibility(repo, set(state.keys()) | set([originalwd]))
 
         self.originalwd = originalwd
         self.target = target
@@ -1203,7 +1203,8 @@
     dest: context
     rebaseset: set of rev
     '''
-    _setrebasesetvisibility(repo, set(rebaseset))
+    originalwd = repo['.'].rev()
+    _setrebasesetvisibility(repo, set(rebaseset) | set([originalwd]))
 
     # This check isn't strictly necessary, since mq detects commits over an
     # applied patch. But it prevents messing up the working directory when
@@ -1288,7 +1289,7 @@
             state[r] = revpruned
         else:
             state[r] = revprecursor
-    return repo['.'].rev(), dest.rev(), state
+    return originalwd, dest.rev(), state
 
 def clearrebased(ui, repo, state, skipped, collapsedas=None):
     """dispose of rebased revision at the end of the rebase