D5467: narrow: when narrowing, write new narrowspec before removing revlogs

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Dec 20 14:01:22 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGddedd95b09f1: narrow: when narrowing, write new narrowspec before removing revlogs (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5467?vs=12931&id=12936

REVISION DETAIL
  https://phab.mercurial-scm.org/D5467

AFFECTED FILES
  hgext/narrow/narrowcommands.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py
--- a/hgext/narrow/narrowcommands.py
+++ b/hgext/narrow/narrowcommands.py
@@ -242,14 +242,17 @@
         repo.destroying()
 
         with repo.transaction("narrowing"):
+            # Update narrowspec before removing revlogs, so repo won't be
+            # corrupt in case of crash
+            repo.setnarrowpats(newincludes, newexcludes)
+
             for f in todelete:
                 ui.status(_('deleting %s\n') % f)
                 util.unlinkpath(repo.svfs.join(f))
                 repo.store.markremoved(f)
 
             _narrowcleanupwdir(repo, oldincludes, oldexcludes, newincludes,
                                newexcludes, oldmatch, newmatch)
-            repo.setnarrowpats(newincludes, newexcludes)
 
         repo.destroyed()
 



To: martinvonz, durin42, #hg-reviewers, pulkit
Cc: mercurial-devel


More information about the Mercurial-devel mailing list