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.

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))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.