diff mercurial/commands.py @ 13697:eaee75036725

annotate: catch nonexistent files using match.bad callback (issue1590)
author Matt Mackall <mpm@selenic.com>
date Sat, 19 Mar 2011 01:34:49 -0500
parents 4f5ed2bd1724
children 9c4e04fe267e
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Mar 18 13:01:18 2011 -0500
+++ b/mercurial/commands.py	Sat Mar 19 01:34:49 2011 -0500
@@ -126,8 +126,12 @@
         lastfunc = funcmap[-1]
         funcmap[-1] = lambda x: "%s:%s" % (lastfunc(x), x[1])
 
+    def bad(x, y):
+        raise util.Abort("%s: %s" % (x, y))
+
     ctx = cmdutil.revsingle(repo, opts.get('rev'))
     m = cmdutil.match(repo, pats, opts)
+    m.bad = bad
     follow = not opts.get('no_follow')
     for abs in ctx.walk(m):
         fctx = ctx[abs]