Mercurial > hg-stable
changeset 4273:4a1504264261
Fix localrepo.copy to deal with symbolic links.
author | Eric St-Jean <esj@wwd.ca> |
---|---|
date | Wed, 21 Mar 2007 23:20:56 -0400 |
parents | ad33eeeeb50a |
children | af4f0d52f948 |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Wed Mar 21 23:20:56 2007 -0400 +++ b/mercurial/localrepo.py Wed Mar 21 23:20:56 2007 -0400 @@ -1072,10 +1072,11 @@ def copy(self, source, dest, wlock=None): p = self.wjoin(dest) - if not os.path.exists(p): + if not (os.path.exists(p) or os.path.islink(p)): self.ui.warn(_("%s does not exist!\n") % dest) - elif not os.path.isfile(p): - self.ui.warn(_("copy failed: %s is not a file\n") % dest) + elif not (os.path.isfile(p) or os.path.islink(p)): + self.ui.warn(_("copy failed: %s is not a file or a " + "symbolic link\n") % dest) else: if not wlock: wlock = self.wlock()