# HG changeset patch # User Yuya Nishihara # Date 1508680151 -32400 # Node ID b14c8bcfbad9f95dd62736bf6c52958663fa5bab # Parent b6dbc860570d7164ae31a24406554a38c9776fee log: drop unused expr from return value of getlogrevs() Future patches will move some processing of the --follow option out of _makelogrevset(), where the returned 'expr' value will be less consistent with the 'revs'. So let's remove it from the public interface. diff -r b6dbc860570d -r b14c8bcfbad9 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Thu Jan 04 12:00:18 2018 +0900 +++ b/mercurial/cmdutil.py Sun Oct 22 22:49:11 2017 +0900 @@ -2505,17 +2505,16 @@ return revs def getlogrevs(repo, pats, opts): - """Return (revs, expr, filematcher) where revs is an iterable of - revision numbers, expr is a revset string built from log options - and file patterns or None, and used to filter 'revs'. If --stat or - --patch are not passed filematcher is None. Otherwise it is a - callable taking a revision number and returning a match objects + """Return (revs, filematcher) where revs is a smartset + + If --stat or --patch is not passed, filematcher is None. Otherwise it + is a callable taking a revision number and returning a match objects filtering the files to be detailed when displaying the revision. """ limit = loglimit(opts) revs = _logrevs(repo, opts) if not revs: - return smartset.baseset(), None, None + return smartset.baseset(), None expr, filematcher = _makelogrevset(repo, pats, opts, revs) if opts.get('graph') and opts.get('rev'): # User-specified revs might be unsorted, but don't sort before @@ -2527,7 +2526,7 @@ revs = matcher(repo, revs) if limit is not None: revs = revs.slice(0, limit) - return revs, expr, filematcher + return revs, filematcher def _parselinerangelogopt(repo, opts): """Parse --line-range log option and return a list of tuples (filename, diff -r b6dbc860570d -r b14c8bcfbad9 mercurial/commands.py --- a/mercurial/commands.py Thu Jan 04 12:00:18 2018 +0900 +++ b/mercurial/commands.py Sun Oct 22 22:49:11 2017 +0900 @@ -3410,7 +3410,7 @@ del opts['follow'] repo = scmutil.unhidehashlikerevs(repo, opts.get('rev'), 'nowarn') - revs, expr, filematcher = cmdutil.getlogrevs(repo, pats, opts) + revs, filematcher = cmdutil.getlogrevs(repo, pats, opts) hunksfilter = None if opts.get('graph'): diff -r b6dbc860570d -r b14c8bcfbad9 tests/test-glog.t --- a/tests/test-glog.t Thu Jan 04 12:00:18 2018 +0900 +++ b/tests/test-glog.t Sun Oct 22 22:49:11 2017 +0900 @@ -90,10 +90,16 @@ > revsetlang, > ) > + > def logrevset(repo, pats, opts): + > revs = cmdutil._logrevs(repo, opts) + > if not revs: + > return None + > return cmdutil._makelogrevset(repo, pats, opts, revs)[0] + > > def uisetup(ui): > def printrevset(orig, ui, repo, *pats, **opts): > if opts.get('print_revset'): - > expr = cmdutil.getlogrevs(repo, pats, opts)[1] + > expr = logrevset(repo, pats, opts) > if expr: > tree = revsetlang.parse(expr) > else: