Mercurial > hg
comparison mercurial/revset.py @ 30392:155d7ea98085
revset: avoid shadowing a variable with a list comprehension
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 10 Nov 2016 16:35:10 -0500 |
parents | 318a24b52eeb |
children | 5bda147c3139 |
comparison
equal
deleted
inserted
replaced
30391:2ded17b64f09 | 30392:155d7ea98085 |
---|---|
435 raise error.ParseError(_("can't use a key-value pair in this context")) | 435 raise error.ParseError(_("can't use a key-value pair in this context")) |
436 | 436 |
437 def func(repo, subset, a, b, order): | 437 def func(repo, subset, a, b, order): |
438 f = getsymbol(a) | 438 f = getsymbol(a) |
439 if f in symbols: | 439 if f in symbols: |
440 fn = symbols[f] | 440 func = symbols[f] |
441 if getattr(fn, '_takeorder', False): | 441 if getattr(func, '_takeorder', False): |
442 return fn(repo, subset, b, order) | 442 return func(repo, subset, b, order) |
443 return fn(repo, subset, b) | 443 return func(repo, subset, b) |
444 | 444 |
445 keep = lambda fn: getattr(fn, '__doc__', None) is not None | 445 keep = lambda fn: getattr(fn, '__doc__', None) is not None |
446 | 446 |
447 syms = [s for (s, fn) in symbols.items() if keep(fn)] | 447 syms = [s for (s, fn) in symbols.items() if keep(fn)] |
448 raise error.UnknownIdentifier(f, syms) | 448 raise error.UnknownIdentifier(f, syms) |