# HG changeset patch # User Alexis S. L. Carvalho # Date 1167962513 7200 # Node ID dfe87137ed143fc658489acc765d411937f33a43 # Parent ea6174c96ae1609f700e6881a47dad46e5b7b077 Allow adding symlinks that don't point to files diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -933,11 +933,12 @@ class localrepository(repo.repository): wlock = self.wlock() for f in list: p = self.wjoin(f) - if not os.path.exists(p): + islink = os.path.islink(p) + if not islink and not os.path.exists(p): self.ui.warn(_("%s does not exist!\n") % f) - elif not os.path.isfile(p): - self.ui.warn(_("%s not added: only files supported currently\n") - % f) + elif not islink and not os.path.isfile(p): + self.ui.warn(_("%s not added: only files and symlinks " + "supported currently\n") % f) elif self.dirstate.state(f) in 'an': self.ui.warn(_("%s already tracked!\n") % f) else: