Show More
@@ -86,6 +86,10 b' class Shelf(object):' | |||||
86 | def open(repo, name): |
|
86 | def open(repo, name): | |
87 | return Shelf(vfsmod.vfs(repo.vfs.join(shelvedir)), name) |
|
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 | def exists(self): |
|
93 | def exists(self): | |
90 | return self.vfs.exists(self.name + b'.patch') and self.vfs.exists( |
|
94 | return self.vfs.exists(self.name + b'.patch') and self.vfs.exists( | |
91 | self.name + b'.hg' |
|
95 | self.name + b'.hg' | |
@@ -181,6 +185,10 b' class Shelf(object):' | |||||
181 | self._backupfilename(backupvfs, filename), |
|
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 | class shelvedstate(object): |
|
193 | class shelvedstate(object): | |
186 | """Handle persistence during unshelving operations. |
|
194 | """Handle persistence during unshelving operations. | |
@@ -332,8 +340,7 b' def cleanupoldbackups(repo):' | |||||
332 | if mtime == bordermtime: |
|
340 | if mtime == bordermtime: | |
333 | # keep it, because timestamp can't decide exact order of backups |
|
341 | # keep it, because timestamp can't decide exact order of backups | |
334 | continue |
|
342 | continue | |
335 | for ext in shelvefileextensions: |
|
343 | Shelf.open_backup(repo, name).delete() | |
336 | vfs.tryunlink(name + b'.' + ext) |
|
|||
337 |
|
344 | |||
338 |
|
345 | |||
339 | def _backupactivebookmark(repo): |
|
346 | def _backupactivebookmark(repo): |
General Comments 0
You need to be logged in to leave comments.
Login now