--- a/mercurial/hg.py Mon Jul 04 11:06:01 2005 -0800
+++ b/mercurial/hg.py Mon Jul 04 11:20:20 2005 -0800
@@ -753,8 +753,10 @@
def add(self, list):
for f in list:
p = self.wjoin(f)
- if not os.path.isfile(p):
- self.ui.warn("%s does not exist!\n" % f)
+ if 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: mercurial only supports files currently\n" % f)
elif self.dirstate.state(f) == 'n':
self.ui.warn("%s already tracked!\n" % f)
else:
@@ -770,7 +772,7 @@
def remove(self, list):
for f in list:
p = self.wjoin(f)
- if os.path.isfile(p):
+ if os.path.exists(p):
self.ui.warn("%s still exists!\n" % f)
elif self.dirstate.state(f) == 'a':
self.ui.warn("%s never committed!\n" % f)
@@ -782,8 +784,10 @@
def copy(self, source, dest):
p = self.wjoin(dest)
- if not os.path.isfile(dest):
+ if not os.path.exists(dest):
self.ui.warn("%s does not exist!\n" % dest)
+ elif not os.path.isfile(dest):
+ self.ui.warn("copy failed: %s is not a file\n" % dest)
else:
if self.dirstate.state(dest) == '?':
self.dirstate.update([dest], "a")