changeset 38529:1ad873c3e4a4

narrowbundle2: when we handle a widen, mark the operation as unsafe We have to manually drive the context manager here since the logic is awkwardly split between a couple of places. Differential Revision: https://phab.mercurial-scm.org/D3719
author Augie Fackler <augie@google.com>
date Tue, 12 Jun 2018 11:31:20 -0400
parents a1d5951efce7
children c82ea938efbb
files hgext/narrow/narrowbundle2.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/narrow/narrowbundle2.py	Mon Jun 11 17:06:29 2018 -0400
+++ b/hgext/narrow/narrowbundle2.py	Tue Jun 12 11:31:20 2018 -0400
@@ -408,6 +408,8 @@
                                  topic='widen')
         repo._bookmarks = bmstore
         if chgrpfile:
+            op._widen_uninterr = repo.ui.uninterruptable()
+            op._widen_uninterr.__enter__()
             # presence of _widen_bundle attribute activates widen handler later
             op._widen_bundle = chgrpfile
     # Set the new narrowspec if we're widening. The setnewnarrowpats() method
@@ -455,6 +457,7 @@
                         (undovfs.join(undofile), stringutil.forcebytestr(e)))
 
     # Remove partial backup only if there were no exceptions
+    op._widen_uninterr.__exit__(None, None, None)
     vfs.unlink(chgrpfile)
 
 def setup():