mq: use util.unlink instead of os.unlink and os.removedirs stable
authorHenrik Stuart <henrik.stuart@edlund.dk>
Wed, 07 Apr 2010 16:55:01 +0200
branchstable
changeset 10872 9606edb8777e
parent 10866 532138ba8a06
child 10873 bbf496db0766
child 10874 4f11978ae45d
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.
hgext/mq.py
--- 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))