abort if explicitly committed files are not found or not tracked
authorMatt Mackall <mpm@selenic.com>
Wed, 15 Nov 2006 23:59:39 -0600
changeset 3663 b4903debbe3b
parent 3662 f4dc02d7fb71
child 3671 86d3f966201d
abort if explicitly committed files are not found or not tracked
mercurial/commands.py
--- a/mercurial/commands.py	Wed Nov 15 23:37:45 2006 -0600
+++ b/mercurial/commands.py	Wed Nov 15 23:59:39 2006 -0600
@@ -418,8 +418,15 @@
         cmdutil.addremove(repo, pats, opts)
     fns, match, anypats = cmdutil.matchpats(repo, pats, opts)
     if pats:
-        modified, added, removed = repo.status(files=fns, match=match)[:3]
+        status = repo.status(files=fns, match=match)
+        modified, added, removed, deleted, unknown = status[:5]
         files = modified + added + removed
+        for f in fns:
+            if f not in modified + added + removed:
+                if f in unknown:
+                    raise util.Abort(_("file %s not tracked!") % f)
+                else:
+                    raise util.Abort(_("file %s not found!") % f)
     else:
         files = []
     try: