--- a/hgext/purge.py Sat Aug 02 09:44:45 2014 +0100
+++ b/hgext/purge.py Sat Aug 02 09:45:21 2014 +0100
@@ -95,17 +95,6 @@
else:
ui.write('%s%s' % (name, eol))
- def removefile(path):
- try:
- os.remove(path)
- except OSError:
- # read-only files cannot be unlinked under Windows
- s = os.stat(path)
- if (s.st_mode & stat.S_IWRITE) != 0:
- raise
- os.chmod(path, stat.S_IMODE(s.st_mode) | stat.S_IWRITE)
- os.remove(path)
-
directories = []
match = scmutil.match(repo[None], dirs, opts)
match.explicitdir = match.traversedir = directories.append
@@ -115,7 +104,7 @@
for f in sorted(status[4] + status[5]):
if act:
ui.note(_('removing file %s\n') % f)
- remove(removefile, f)
+ remove(util.unlink, f)
if removedirs:
for f in sorted(directories, reverse=True):