##// END OF EJS Templates
refactoring: use unlinkpath with ignoremissing
Mads Kiilerich -
r18386:03442135 default
parent child Browse files
Show More
@@ -170,8 +170,7 b' def removelargefiles(ui, repo, *pats, **'
170 # are removing the file.
170 # are removing the file.
171 if getattr(repo, "_isaddremove", False):
171 if getattr(repo, "_isaddremove", False):
172 ui.status(_('removing %s\n') % f)
172 ui.status(_('removing %s\n') % f)
173 if os.path.exists(repo.wjoin(f)):
173 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
174 util.unlinkpath(repo.wjoin(f))
175 lfdirstate.remove(f)
174 lfdirstate.remove(f)
176 lfdirstate.write()
175 lfdirstate.write()
177 forget = [lfutil.standin(f) for f in forget]
176 forget = [lfutil.standin(f) for f in forget]
@@ -319,8 +319,7 b' def rebase(ui, repo, **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
@@ -508,8 +507,7 b' def storestatus(repo, originalwd, target'
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'
@@ -2947,8 +2947,8 b' def graft(ui, repo, *revs, **opts):'
2947 wlock.release()
2947 wlock.release()
2948
2948
2949 # remove state when we complete successfully
2949 # remove state when we complete successfully
2950 if not opts.get('dry_run') and os.path.exists(repo.join('graftstate')):
2950 if not opts.get('dry_run'):
2951 util.unlinkpath(repo.join('graftstate'))
2951 util.unlinkpath(repo.join('graftstate'), ignoremissing=True)
2952
2952
2953 return 0
2953 return 0
2954
2954
General Comments 0
You need to be logged in to leave comments. Login now