changeset 22236:3c24fb96900f

revert: handle unknown files through status This will allow us to drop the code dedicated to this special case.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 25 Jun 2014 00:01:30 +0100
parents 41a07d4f909f
children 808926c76cac
files mercurial/cmdutil.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Tue Jun 24 23:55:43 2014 +0100
+++ b/mercurial/cmdutil.py	Wed Jun 25 00:01:30 2014 +0100
@@ -2378,11 +2378,14 @@
         # Find status of all file in `names`.
         m = scmutil.matchfiles(repo, names)
 
-        changes = repo.status(node1=node, match=m, clean=True)
+        changes = repo.status(node1=node, match=m,
+                              unknown=True, ignored=True, clean=True)
         modified = set(changes[0])
         added    = set(changes[1])
         removed  = set(changes[2])
-        _deleted  = set(changes[3])
+        _deleted = set(changes[3])
+        unknown  = set(changes[4])
+        unknown.update(changes[5])
         clean    = set(changes[6])
 
         # split between files known in target manifest and the others
@@ -2471,6 +2474,7 @@
                    'remove': ([], removeforget),
                    'undelete': ([], _('undeleting %s\n')),
                    'noop': (None, _('no changes needed to %s\n')),
+                   'unknown': (None, _('file not managed: %s\n')),
                   }
 
 
@@ -2489,6 +2493,7 @@
             (removed,    actions['add'],      backup),
             (dsremoved,  actions['undelete'], backup),
             (clean,      actions['noop'],     discard),
+            (unknown,    actions['unknown'],  discard),
             )
 
         for abs, (rel, exact) in sorted(names.items()):