Mercurial > public > mercurial-scm > hg
diff mercurial/merge.py @ 18143:242d2f4ec01c
util: fold ENOENT check into unlinkpath, controlled by new ignoremissing flag
Refactor a common pattern.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 28 Dec 2012 11:55:57 +0100 |
parents | 6c35b53cd28b |
children | 2fee5119099b |
line wrap: on
line diff
--- a/mercurial/merge.py Fri Dec 28 11:55:45 2012 +0100 +++ b/mercurial/merge.py Fri Dec 28 11:55:57 2012 +0100 @@ -382,11 +382,10 @@ if f == '.hgsubstate': # subrepo states need updating subrepo.submerge(repo, wctx, mctx, wctx, overwrite) try: - util.unlinkpath(repo.wjoin(f)) + util.unlinkpath(repo.wjoin(f), ignoremissing=True) except OSError, inst: - if inst.errno != errno.ENOENT: - repo.ui.warn(_("update failed to remove %s: %s!\n") % - (f, inst.strerror)) + repo.ui.warn(_("update failed to remove %s: %s!\n") % + (f, inst.strerror)) removed += 1 elif m == "m": # merge if f == '.hgsubstate': # subrepo states need updating