mq: use util.unlink instead of os.unlink and os.removedirs
If, on Windows, your repository and working copy are in a reparse point and you
use os.removedirs, you will remove non-empty reparse points, disabling the
reparse point. See @
fa901423ac23.
--- a/hgext/mq.py Tue Apr 06 15:39:44 2010 +0200
+++ b/hgext/mq.py Wed Apr 07 16:55:01 2010 +0200
@@ -1179,12 +1179,10 @@
raise util.Abort(_("deletions found between repo revs"))
for f in a:
try:
- os.unlink(repo.wjoin(f))
+ util.unlink(repo.wjoin(f))
except OSError, e:
if e.errno != errno.ENOENT:
raise
- try: os.removedirs(os.path.dirname(repo.wjoin(f)))
- except: pass
repo.dirstate.forget(f)
for f in m:
getfile(f, mmap[f], mmap.flags(f))