diff hgext/shelve.py @ 33440:ec306bc6915b

dirstate: update backup functions to take full backup filename Update the dirstate functions so that the caller supplies the full backup filename rather than just a prefix and suffix. The localrepo code was already hard-coding the fact that the backup name must be (exactly prefix + "dirstate" + suffix): it relied on this in _journalfiles() and undofiles(). Making the caller responsible for specifying the full backup name removes the need for the localrepo code to assume that dirstate._filename is always "dirstate". Differential Revision: https://phab.mercurial-scm.org/D68
author Adam Simpkins <simpkins@fb.com>
date Wed, 12 Jul 2017 15:24:07 -0700
parents ea03b3223611
children f7d41b85bbf6
line wrap: on
line diff
--- a/hgext/shelve.py	Thu Jul 13 09:51:50 2017 -0700
+++ b/hgext/shelve.py	Wed Jul 12 15:24:07 2017 -0700
@@ -297,9 +297,10 @@
     '''Abort current transaction for shelve/unshelve, but keep dirstate
     '''
     tr = repo.currenttransaction()
-    repo.dirstate.savebackup(tr, suffix='.shelve')
+    backupname = 'dirstate.shelve'
+    repo.dirstate.savebackup(tr, backupname)
     tr.abort()
-    repo.dirstate.restorebackup(None, suffix='.shelve')
+    repo.dirstate.restorebackup(None, backupname)
 
 def createcmd(ui, repo, pats, opts):
     """subcommand that creates a new shelve"""