comparison hgext/rebase.py @ 18386:03442135dff4

refactoring: use unlinkpath with ignoremissing
author Mads Kiilerich <madski@unity3d.com>
date Tue, 15 Jan 2013 23:30:10 +0100
parents 9454e40e047b
children 100fdc84670f
comparison
equal deleted inserted replaced
18385:bafbfe0b450c 18386:03442135dff4
317 if currentbookmarks: 317 if currentbookmarks:
318 updatebookmarks(repo, nstate, currentbookmarks, **opts) 318 updatebookmarks(repo, nstate, currentbookmarks, **opts)
319 319
320 clearstatus(repo) 320 clearstatus(repo)
321 ui.note(_("rebase completed\n")) 321 ui.note(_("rebase completed\n"))
322 if os.path.exists(repo.sjoin('undo')): 322 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True)
323 util.unlinkpath(repo.sjoin('undo'))
324 if skipped: 323 if skipped:
325 ui.note(_("%d revisions have been skipped\n") % len(skipped)) 324 ui.note(_("%d revisions have been skipped\n") % len(skipped))
326 325
327 if (activebookmark and 326 if (activebookmark and
328 repo['tip'].node() == repo._bookmarks[activebookmark]): 327 repo['tip'].node() == repo._bookmarks[activebookmark]):
506 f.close() 505 f.close()
507 repo.ui.debug('rebase status stored\n') 506 repo.ui.debug('rebase status stored\n')
508 507
509 def clearstatus(repo): 508 def clearstatus(repo):
510 'Remove the status files' 509 'Remove the status files'
511 if os.path.exists(repo.join("rebasestate")): 510 util.unlinkpath(repo.join("rebasestate"), ignoremissing=True)
512 util.unlinkpath(repo.join("rebasestate"))
513 511
514 def restorestatus(repo): 512 def restorestatus(repo):
515 'Restore a previously stored status' 513 'Restore a previously stored status'
516 try: 514 try:
517 target = None 515 target = None