# HG changeset patch # User Eric St-Jean # Date 1174533656 14400 # Node ID 4a15042642610e8cf8ef51fb11e1623ccbeb5dd1 # Parent ad33eeeeb50a3d07451e25f37988b4e5cc5a3d6c Fix localrepo.copy to deal with symbolic links. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1072,10 +1072,11 @@ class localrepository(repo.repository): 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()