Patrick Mézard  committed aca8b10

patch: do not overwrite broken untracked symlinks

  • Participants
  • Parent commits b0bb724
  • Branches stable

Comments (0)

Files changed (3)

File mercurial/

 def copyfile(src, dst, basedir):
     abssrc, absdst = [util.canonpath(basedir, basedir, x) for x in [src, dst]]
-    if os.path.exists(absdst):
+    if os.path.lexists(absdst):
         raise util.Abort(_("cannot create %s: destination already exists") %

File tests/test-mq-symlinks.out

 applying movelink
 now at: movelink
 linkb -> linkb
+% check patch does not overwrite untracked symlinks
+popping movelink
+now at: link
+applying movelink
+patch failed, unable to continue (try -v)
+patch failed, rejects left in working dir
+errors during apply, please fix and refresh movelink