Commit 58c7bc6e authored by Matt Mackall's avatar Matt Mackall
Browse files

annotate: catch nonexistent files using match.bad callback (issue1590)

parent 136854393eed
......@@ -126,8 +126,12 @@ def annotate(ui, repo, *pats, **opts):
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]
......@@ -228,3 +228,8 @@ annotate after ABA with follow
$ hg annotate --follow foo
foo: foo
missing file
$ hg ann nosuchfile
abort: nosuchfile: no such file in rev c8abddb41a00
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment