changeset 16167:94a8396c9305

addremove: return 1 if we failed to handle any explicit files
author Matt Mackall <mpm@selenic.com>
date Fri, 24 Feb 2012 16:52:32 -0600
parents 5b0a4383cd5e
children 7bbabfe25321
files mercurial/scmutil.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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: