changeset 4574:b841dc886ba1

commands.commit: don't use the unknown list
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Wed, 13 Jun 2007 19:15:58 -0300
parents d092e962c4f8
children b36d8cd1d8ff
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -404,8 +404,6 @@ def commit(ui, repo, *pats, **opts):
                 continue
             if f not in files:
                 rf = repo.wjoin(f)
-                if f in unknown:
-                    raise util.Abort(_("file %s not tracked!") % rf)
                 try:
                     mode = os.lstat(rf)[stat.ST_MODE]
                 except OSError:
@@ -422,6 +420,8 @@ def commit(ui, repo, *pats, **opts):
                 elif not (stat.S_ISREG(mode) or stat.S_ISLNK(mode)):
                     raise util.Abort(_("can't commit %s: "
                                        "unsupported file type!") % rf)
+                elif repo.dirstate.state(f) == '?':
+                    raise util.Abort(_("file %s not tracked!") % rf)
     else:
         files = []
     try: