mercurial/dirstate.py
changeset 29273 118a605e3ad9
parent 29269 b6f9934cf10b
child 29301 28f37ffc0a91
--- a/mercurial/dirstate.py	Tue May 24 13:29:53 2016 -0700
+++ b/mercurial/dirstate.py	Thu May 26 17:36:44 2016 -0700
@@ -1211,6 +1211,7 @@
 
     def savebackup(self, tr, suffix='', prefix=''):
         '''Save current dirstate into backup file with suffix'''
+        assert len(suffix) > 0 or len(prefix) > 0
         filename = self._actualfilename(tr)
 
         # use '_writedirstate' instead of 'write' to write changes certainly,
@@ -1235,6 +1236,7 @@
 
     def restorebackup(self, tr, suffix='', prefix=''):
         '''Restore dirstate by backup file with suffix'''
+        assert len(suffix) > 0 or len(prefix) > 0
         # this "invalidate()" prevents "wlock.release()" from writing
         # changes of dirstate out after restoring from backup file
         self.invalidate()
@@ -1244,5 +1246,6 @@
 
     def clearbackup(self, tr, suffix='', prefix=''):
         '''Clear backup file with suffix'''
+        assert len(suffix) > 0 or len(prefix) > 0
         # using self._filename to avoid having "pending" in the backup filename
         self._opener.unlink(prefix + self._filename + suffix)