##// END OF EJS Templates
distate: add assertions to backup functions...
Mateusz Kwapich -
r29273:118a605e default
parent child Browse files
Show More
@@ -1211,6 +1211,7 b' class dirstate(object):'
1211 1211
1212 1212 def savebackup(self, tr, suffix='', prefix=''):
1213 1213 '''Save current dirstate into backup file with suffix'''
1214 assert len(suffix) > 0 or len(prefix) > 0
1214 1215 filename = self._actualfilename(tr)
1215 1216
1216 1217 # use '_writedirstate' instead of 'write' to write changes certainly,
@@ -1235,6 +1236,7 b' class dirstate(object):'
1235 1236
1236 1237 def restorebackup(self, tr, suffix='', prefix=''):
1237 1238 '''Restore dirstate by backup file with suffix'''
1239 assert len(suffix) > 0 or len(prefix) > 0
1238 1240 # this "invalidate()" prevents "wlock.release()" from writing
1239 1241 # changes of dirstate out after restoring from backup file
1240 1242 self.invalidate()
@@ -1244,5 +1246,6 b' class dirstate(object):'
1244 1246
1245 1247 def clearbackup(self, tr, suffix='', prefix=''):
1246 1248 '''Clear backup file with suffix'''
1249 assert len(suffix) > 0 or len(prefix) > 0
1247 1250 # using self._filename to avoid having "pending" in the backup filename
1248 1251 self._opener.unlink(prefix + self._filename + suffix)
General Comments 0
You need to be logged in to leave comments. Login now