##// END OF EJS Templates
shelve: add a method for deleting shelf to new shelf class...
Martin von Zweigbergk -
r47013:f8c5e6ec default
parent child Browse files
Show More
@@ -86,6 +86,10 b' class Shelf(object):'
86 86 def open(repo, name):
87 87 return Shelf(vfsmod.vfs(repo.vfs.join(shelvedir)), name)
88 88
89 @staticmethod
90 def open_backup(repo, name):
91 return Shelf(vfsmod.vfs(repo.vfs.join(backupdir)), name)
92
89 93 def exists(self):
90 94 return self.vfs.exists(self.name + b'.patch') and self.vfs.exists(
91 95 self.name + b'.hg'
@@ -181,6 +185,10 b' class Shelf(object):'
181 185 self._backupfilename(backupvfs, filename),
182 186 )
183 187
188 def delete(self):
189 for ext in shelvefileextensions:
190 self.vfs.tryunlink(self.name + b'.' + ext)
191
184 192
185 193 class shelvedstate(object):
186 194 """Handle persistence during unshelving operations.
@@ -332,8 +340,7 b' def cleanupoldbackups(repo):'
332 340 if mtime == bordermtime:
333 341 # keep it, because timestamp can't decide exact order of backups
334 342 continue
335 for ext in shelvefileextensions:
336 vfs.tryunlink(name + b'.' + ext)
343 Shelf.open_backup(repo, name).delete()
337 344
338 345
339 346 def _backupactivebookmark(repo):
General Comments 0
You need to be logged in to leave comments. Login now