Mercurial > hg
comparison mercurial/patch.py @ 12341:aca8b10bca6e stable
patch: do not overwrite broken untracked symlinks
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 20 Sep 2010 21:42:11 +0200 |
parents | b0bb72460c44 |
children | b6173aee4a47 |
comparison
equal
deleted
inserted
replaced
12340:b0bb72460c44 | 12341:aca8b10bca6e |
---|---|
23 | 23 |
24 # helper functions | 24 # helper functions |
25 | 25 |
26 def copyfile(src, dst, basedir): | 26 def copyfile(src, dst, basedir): |
27 abssrc, absdst = [util.canonpath(basedir, basedir, x) for x in [src, dst]] | 27 abssrc, absdst = [util.canonpath(basedir, basedir, x) for x in [src, dst]] |
28 if os.path.exists(absdst): | 28 if os.path.lexists(absdst): |
29 raise util.Abort(_("cannot create %s: destination already exists") % | 29 raise util.Abort(_("cannot create %s: destination already exists") % |
30 dst) | 30 dst) |
31 | 31 |
32 dstdir = os.path.dirname(absdst) | 32 dstdir = os.path.dirname(absdst) |
33 if dstdir and not os.path.isdir(dstdir): | 33 if dstdir and not os.path.isdir(dstdir): |