mercurial/dirstate.py
changeset 29269 b6f9934cf10b
parent 29247 3e438497edca
child 29273 118a605e3ad9
--- a/mercurial/dirstate.py	Sat May 28 12:58:46 2016 -0700
+++ b/mercurial/dirstate.py	Wed May 25 16:36:16 2016 -0700
@@ -1230,7 +1230,7 @@
             # end of this transaction
             tr.registertmp(filename, location='plain')
 
-        self._opener.write(prefix + filename + suffix,
+        self._opener.write(prefix + self._filename + suffix,
                            self._opener.tryread(filename))
 
     def restorebackup(self, tr, suffix='', prefix=''):
@@ -1239,9 +1239,10 @@
         # changes of dirstate out after restoring from backup file
         self.invalidate()
         filename = self._actualfilename(tr)
-        self._opener.rename(prefix + filename + suffix, filename)
+        # using self._filename to avoid having "pending" in the backup filename
+        self._opener.rename(prefix + self._filename + suffix, filename)
 
     def clearbackup(self, tr, suffix='', prefix=''):
         '''Clear backup file with suffix'''
-        filename = self._actualfilename(tr)
-        self._opener.unlink(prefix + filename + suffix)
+        # using self._filename to avoid having "pending" in the backup filename
+        self._opener.unlink(prefix + self._filename + suffix)