changeset 4018:dfe87137ed14

Allow adding symlinks that don't point to files
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 05 Jan 2007 00:01:53 -0200
parents ea6174c96ae1
children bf329bda51a6
files mercurial/localrepo.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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: