Mercurial > hg
comparison hgext/shelve.py @ 31543:d5758760c0f4
shelve: use tryunlink
author | Ryan McElroy <rmcelroy@fb.com> |
---|---|
date | Tue, 21 Mar 2017 06:50:28 -0700 |
parents | d1ce2124ec83 |
children | 7485e45807e4 |
comparison
equal
deleted
inserted
replaced
31542:fad440db3565 | 31543:d5758760c0f4 |
---|---|
234 if mtime == bordermtime: | 234 if mtime == bordermtime: |
235 # keep it, because timestamp can't decide exact order of backups | 235 # keep it, because timestamp can't decide exact order of backups |
236 continue | 236 continue |
237 base = f[:-(1 + len(patchextension))] | 237 base = f[:-(1 + len(patchextension))] |
238 for ext in shelvefileextensions: | 238 for ext in shelvefileextensions: |
239 try: | 239 vfs.tryunlink(base + '.' + ext) |
240 vfs.unlink(base + '.' + ext) | |
241 except OSError as err: | |
242 if err.errno != errno.ENOENT: | |
243 raise | |
244 | 240 |
245 def _aborttransaction(repo): | 241 def _aborttransaction(repo): |
246 '''Abort current transaction for shelve/unshelve, but keep dirstate | 242 '''Abort current transaction for shelve/unshelve, but keep dirstate |
247 ''' | 243 ''' |
248 tr = repo.currenttransaction() | 244 tr = repo.currenttransaction() |