Commits

Henrik Stuart committed 9606edb

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.

  • Participants
  • Parent commits 532138b
  • Branches stable

Comments (0)

Files changed (1)

                     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))