##// END OF EJS Templates
tests: use pyflakes as a tool, not a python module...
tests: use pyflakes as a tool, not a python module The usage of pyflakes as a Python module was introduced in e397c6d74652, to work around issue between Python 2 and Python 3. This issues are long behind us now and we can get beck to using pyflakes as a tool, giving us more flexibility about how we install it. The `hghave` requirements is modified to check that we have a tool available, instead of a python module.

File last commit:

r49730:6000f5b2 default
r52956:43602c67 default
Show More
printrevset.py
49 lines | 1.4 KiB | text/x-python | PythonLexer
Yuya Nishihara
log: introduce struct that carries log traversal options...
r46139 from mercurial.thirdparty import attr
Augie Fackler
tests: extract printrevset extension from test-glog-beautifygraph.t...
r39093 from mercurial import (
Augie Fackler
formatting: blacken the codebase...
r43346 cmdutil,
commands,
extensions,
logcmdutil,
revsetlang,
smartset,
Augie Fackler
tests: extract printrevset extension from test-glog-beautifygraph.t...
r39093 )
Augie Fackler
formatting: blacken the codebase...
r43346 from mercurial.utils import stringutil
Augie Fackler
tests: extract printrevset extension from test-glog-beautifygraph.t...
r39093
Yuya Nishihara
log: introduce struct that carries log traversal options...
r46139 def logrevset(repo, wopts):
revs = logcmdutil._initialrevs(repo, wopts)
Augie Fackler
tests: extract printrevset extension from test-glog-beautifygraph.t...
r39093 if not revs:
return None
Yuya Nishihara
log: introduce struct that carries log traversal options...
r46139 match, pats, slowpath = logcmdutil._makematcher(repo, revs, wopts)
wopts = attr.evolve(wopts, pats=pats)
return logcmdutil._makerevset(repo, wopts, slowpath)
Augie Fackler
tests: extract printrevset extension from test-glog-beautifygraph.t...
r39093
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
tests: extract printrevset extension from test-glog-beautifygraph.t...
r39093 def uisetup(ui):
Yuya Nishihara
log: introduce struct that carries log traversal options...
r46139 def printrevset(orig, repo, wopts):
revs, filematcher = orig(repo, wopts)
if wopts.opts.get(b'print_revset'):
expr = logrevset(repo, wopts)
Augie Fackler
tests: extract printrevset extension from test-glog-beautifygraph.t...
r39093 if expr:
tree = revsetlang.parse(expr)
tree = revsetlang.analyze(tree)
else:
tree = []
ui = repo.ui
Yuya Nishihara
log: introduce struct that carries log traversal options...
r46139 ui.write(b'%s\n' % stringutil.pprint(wopts.opts.get(b'rev', [])))
Augie Fackler
tests: extract printrevset extension from test-glog-beautifygraph.t...
r39093 ui.write(revsetlang.prettyformat(tree) + b'\n')
ui.write(stringutil.prettyrepr(revs) + b'\n')
revs = smartset.baseset() # display no revisions
return revs, filematcher
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
tests: extract printrevset extension from test-glog-beautifygraph.t...
r39093 extensions.wrapfunction(logcmdutil, 'getrevs', printrevset)
aliases, entry = cmdutil.findcmd(b'log', commands.table)
Augie Fackler
formatting: blacken the codebase...
r43346 entry[1].append(
(
b'',
b'print-revset',
False,
b'print generated revset and exit (DEPRECATED)',
)
)