# 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 -r ea6174c96ae1 -r dfe87137ed14 mercurial/localrepo.py --- a/mercurial/localrepo.py Fri Jan 05 00:01:51 2007 -0200 +++ b/mercurial/localrepo.py Fri Jan 05 00:01:53 2007 -0200 @@ -933,11 +933,12 @@ 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: