Show More
@@ -17,8 +17,7 b' from mercurial.commands import templateo' | |||
|
17 | 17 | from mercurial.i18n import _ |
|
18 | 18 | from mercurial.node import nullrev |
|
19 | 19 | from mercurial import cmdutil, commands, extensions, scmutil |
|
20 | from mercurial import hg, util, graphmod, templatekw | |
|
21 | from mercurial import revset as revsetmod | |
|
20 | from mercurial import hg, util, graphmod, templatekw, revset | |
|
22 | 21 | |
|
23 | 22 | cmdtable = {} |
|
24 | 23 | command = cmdutil.command(cmdtable) |
@@ -243,7 +242,7 b' def check_unsupported_flags(pats, opts):' | |||
|
243 | 242 | raise util.Abort(_("-G/--graph option is incompatible with --%s") |
|
244 | 243 | % op.replace("_", "-")) |
|
245 | 244 | |
|
246 | def makefilematcher(repo, pats, followfirst): | |
|
245 | def _makefilematcher(repo, pats, followfirst): | |
|
247 | 246 | # When displaying a revision with --patch --follow FILE, we have |
|
248 | 247 | # to know which file of the revision must be diffed. With |
|
249 | 248 | # --follow, we want the names of the ancestors of FILE in the |
@@ -373,11 +372,11 b' def _makelogrevset(repo, pats, opts, rev' | |||
|
373 | 372 | filematcher = None |
|
374 | 373 | if opts.get('patch') or opts.get('stat'): |
|
375 | 374 | if follow: |
|
376 | filematcher = makefilematcher(repo, pats, followfirst) | |
|
375 | filematcher = _makefilematcher(repo, pats, followfirst) | |
|
377 | 376 | else: |
|
378 | 377 | filematcher = lambda rev: match |
|
379 | 378 | |
|
380 |
|
|
|
379 | expr = [] | |
|
381 | 380 | for op, val in opts.iteritems(): |
|
382 | 381 | if not val: |
|
383 | 382 | continue |
@@ -385,19 +384,19 b' def _makelogrevset(repo, pats, opts, rev' | |||
|
385 | 384 | continue |
|
386 | 385 | revop, andor = opt2revset[op] |
|
387 | 386 | if '%(val)' not in revop: |
|
388 |
|
|
|
387 | expr.append(revop) | |
|
389 | 388 | else: |
|
390 | 389 | if not isinstance(val, list): |
|
391 |
e |
|
|
390 | e = revop % {'val': val} | |
|
392 | 391 | else: |
|
393 |
e |
|
|
394 |
|
|
|
392 | e = '(' + andor.join((revop % {'val': v}) for v in val) + ')' | |
|
393 | expr.append(e) | |
|
395 | 394 | |
|
396 |
if |
|
|
397 |
|
|
|
395 | if expr: | |
|
396 | expr = '(' + ' and '.join(expr) + ')' | |
|
398 | 397 | else: |
|
399 |
|
|
|
400 |
return |
|
|
398 | expr = None | |
|
399 | return expr, filematcher | |
|
401 | 400 | |
|
402 | 401 | def getlogrevs(repo, pats, opts): |
|
403 | 402 | """Return (revs, expr, filematcher) where revs is a list of |
@@ -426,7 +425,7 b' def getlogrevs(repo, pats, opts):' | |||
|
426 | 425 | # Evaluate revisions in changelog order for performance |
|
427 | 426 | # reasons but preserve the original sequence order in the |
|
428 | 427 | # filtered result. |
|
429 |
matched = set(revset |
|
|
428 | matched = set(revset.match(repo.ui, expr)(repo, sorted(revs))) | |
|
430 | 429 | revs = [r for r in revs if r in matched] |
|
431 | 430 | return revs, expr, filematcher |
|
432 | 431 |
General Comments 0
You need to be logged in to leave comments.
Login now