##// END OF EJS Templates
annotate: catch nonexistent files using match.bad callback (issue1590)
Matt Mackall -
r13697:eaee7503 default
parent child Browse files
Show More
@@ -126,8 +126,12 b' def annotate(ui, repo, *pats, **opts):'
126 lastfunc = funcmap[-1]
126 lastfunc = funcmap[-1]
127 funcmap[-1] = lambda x: "%s:%s" % (lastfunc(x), x[1])
127 funcmap[-1] = lambda x: "%s:%s" % (lastfunc(x), x[1])
128
128
129 def bad(x, y):
130 raise util.Abort("%s: %s" % (x, y))
131
129 ctx = cmdutil.revsingle(repo, opts.get('rev'))
132 ctx = cmdutil.revsingle(repo, opts.get('rev'))
130 m = cmdutil.match(repo, pats, opts)
133 m = cmdutil.match(repo, pats, opts)
134 m.bad = bad
131 follow = not opts.get('no_follow')
135 follow = not opts.get('no_follow')
132 for abs in ctx.walk(m):
136 for abs in ctx.walk(m):
133 fctx = ctx[abs]
137 fctx = ctx[abs]
@@ -228,3 +228,8 b' annotate after ABA with follow'
228 $ hg annotate --follow foo
228 $ hg annotate --follow foo
229 foo: foo
229 foo: foo
230
230
231 missing file
232
233 $ hg ann nosuchfile
234 abort: nosuchfile: no such file in rev c8abddb41a00
235 [255]
General Comments 0
You need to be logged in to leave comments. Login now