addremove: return 1 if we failed to handle any explicit files
authorMatt Mackall <mpm@selenic.com>
Fri, 24 Feb 2012 16:52:32 -0600
changeset 16167 94a8396c9305
parent 16166 5b0a4383cd5e
child 16168 7bbabfe25321
addremove: return 1 if we failed to handle any explicit files
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Fri Feb 24 16:16:48 2012 -0600
+++ b/mercurial/scmutil.py	Fri Feb 24 16:52:32 2012 -0600
@@ -607,6 +607,9 @@
     added, unknown, deleted, removed = [], [], [], []
     audit_path = pathauditor(repo.root)
     m = match(repo[None], pats, opts)
+    rejected = []
+    m.bad = lambda x, y: rejected.append(x)
+
     for abs in repo.walk(m):
         target = repo.wjoin(abs)
         good = True
@@ -651,6 +654,11 @@
         finally:
             wlock.release()
 
+    for f in rejected:
+        if f in m.files():
+            return 1
+    return 0
+
 def updatedir(ui, repo, patches, similarity=0):
     '''Update dirstate after patch application according to metadata'''
     if not patches: