##// END OF EJS Templates
log: drop unused expr from return value of getlogrevs()...
Yuya Nishihara -
r35562:b14c8bcf default
parent child Browse files
Show More
@@ -2505,17 +2505,16 b' def _logrevs(repo, opts):'
2505 return revs
2505 return revs
2506
2506
2507 def getlogrevs(repo, pats, opts):
2507 def getlogrevs(repo, pats, opts):
2508 """Return (revs, expr, filematcher) where revs is an iterable of
2508 """Return (revs, filematcher) where revs is a smartset
2509 revision numbers, expr is a revset string built from log options
2509
2510 and file patterns or None, and used to filter 'revs'. If --stat or
2510 If --stat or --patch is not passed, filematcher is None. Otherwise it
2511 --patch are not passed filematcher is None. Otherwise it is a
2511 is a callable taking a revision number and returning a match objects
2512 callable taking a revision number and returning a match objects
2513 filtering the files to be detailed when displaying the revision.
2512 filtering the files to be detailed when displaying the revision.
2514 """
2513 """
2515 limit = loglimit(opts)
2514 limit = loglimit(opts)
2516 revs = _logrevs(repo, opts)
2515 revs = _logrevs(repo, opts)
2517 if not revs:
2516 if not revs:
2518 return smartset.baseset(), None, None
2517 return smartset.baseset(), None
2519 expr, filematcher = _makelogrevset(repo, pats, opts, revs)
2518 expr, filematcher = _makelogrevset(repo, pats, opts, revs)
2520 if opts.get('graph') and opts.get('rev'):
2519 if opts.get('graph') and opts.get('rev'):
2521 # User-specified revs might be unsorted, but don't sort before
2520 # User-specified revs might be unsorted, but don't sort before
@@ -2527,7 +2526,7 b' def getlogrevs(repo, pats, opts):'
2527 revs = matcher(repo, revs)
2526 revs = matcher(repo, revs)
2528 if limit is not None:
2527 if limit is not None:
2529 revs = revs.slice(0, limit)
2528 revs = revs.slice(0, limit)
2530 return revs, expr, filematcher
2529 return revs, filematcher
2531
2530
2532 def _parselinerangelogopt(repo, opts):
2531 def _parselinerangelogopt(repo, opts):
2533 """Parse --line-range log option and return a list of tuples (filename,
2532 """Parse --line-range log option and return a list of tuples (filename,
@@ -3410,7 +3410,7 b' def log(ui, repo, *pats, **opts):'
3410 del opts['follow']
3410 del opts['follow']
3411
3411
3412 repo = scmutil.unhidehashlikerevs(repo, opts.get('rev'), 'nowarn')
3412 repo = scmutil.unhidehashlikerevs(repo, opts.get('rev'), 'nowarn')
3413 revs, expr, filematcher = cmdutil.getlogrevs(repo, pats, opts)
3413 revs, filematcher = cmdutil.getlogrevs(repo, pats, opts)
3414 hunksfilter = None
3414 hunksfilter = None
3415
3415
3416 if opts.get('graph'):
3416 if opts.get('graph'):
@@ -90,10 +90,16 b' o (0) root'
90 > revsetlang,
90 > revsetlang,
91 > )
91 > )
92 >
92 >
93 > def logrevset(repo, pats, opts):
94 > revs = cmdutil._logrevs(repo, opts)
95 > if not revs:
96 > return None
97 > return cmdutil._makelogrevset(repo, pats, opts, revs)[0]
98 >
93 > def uisetup(ui):
99 > def uisetup(ui):
94 > def printrevset(orig, ui, repo, *pats, **opts):
100 > def printrevset(orig, ui, repo, *pats, **opts):
95 > if opts.get('print_revset'):
101 > if opts.get('print_revset'):
96 > expr = cmdutil.getlogrevs(repo, pats, opts)[1]
102 > expr = logrevset(repo, pats, opts)
97 > if expr:
103 > if expr:
98 > tree = revsetlang.parse(expr)
104 > tree = revsetlang.parse(expr)
99 > else:
105 > else:
General Comments 0
You need to be logged in to leave comments. Login now