diff mercurial/commands.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 7f5a0eba3768
children c5bd753c5bc6
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Dec 28 11:55:45 2012 +0100
+++ b/mercurial/commands.py	Fri Dec 28 11:55:57 2012 +0100
@@ -4957,11 +4957,7 @@
             for f in list:
                 if f in added:
                     continue # we never unlink added files on remove
-                try:
-                    util.unlinkpath(repo.wjoin(f))
-                except OSError, inst:
-                    if inst.errno != errno.ENOENT:
-                        raise
+                util.unlinkpath(repo.wjoin(f), ignoremissing=True)
         repo[None].forget(list)
     finally:
         wlock.release()