Show More
@@ -268,7 +268,11 b' def revset(repo, pats, opts):' | |||
|
268 | 268 | if 'branch' in opts and 'only_branch' in opts: |
|
269 | 269 | opts['branch'] = opts['branch'] + opts.pop('only_branch') |
|
270 | 270 | |
|
271 | match = scmutil.match(repo[None], pats, opts) | |
|
271 | # pats/include/exclude are passed to match.match() directly in | |
|
272 | # _matchfile() revset but walkchangerevs() builds its matcher with | |
|
273 | # scmutil.match(). The difference is input pats are globbed on | |
|
274 | # platforms without shell expansion (windows). | |
|
275 | match, pats = scmutil.matchandpats(repo[None], pats, opts) | |
|
272 | 276 | slowpath = match.anypats() or (match.files() and opts.get('removed')) |
|
273 | 277 | if not slowpath: |
|
274 | 278 | for f in match.files(): |
@@ -579,7 +579,7 b' def expandpats(pats):' | |||
|
579 | 579 | ret.append(p) |
|
580 | 580 | return ret |
|
581 | 581 | |
|
582 | def match(ctx, pats=[], opts={}, globbed=False, default='relpath'): | |
|
582 | def matchandpats(ctx, pats=[], opts={}, globbed=False, default='relpath'): | |
|
583 | 583 | if pats == ("",): |
|
584 | 584 | pats = [] |
|
585 | 585 | if not globbed and default == 'relpath': |
@@ -590,7 +590,10 b' def match(ctx, pats=[], opts={}, globbed' | |||
|
590 | 590 | def badfn(f, msg): |
|
591 | 591 | ctx._repo.ui.warn("%s: %s\n" % (m.rel(f), msg)) |
|
592 | 592 | m.bad = badfn |
|
593 | return m | |
|
593 | return m, pats | |
|
594 | ||
|
595 | def match(ctx, pats=[], opts={}, globbed=False, default='relpath'): | |
|
596 | return matchandpats(ctx, pats, opts, globbed, default)[0] | |
|
594 | 597 | |
|
595 | 598 | def matchall(repo): |
|
596 | 599 | return matchmod.always(repo.root, repo.getcwd()) |
@@ -1510,8 +1510,10 b' Dedicated repo for --follow and paths fi' | |||
|
1510 | 1510 | $ hg init follow |
|
1511 | 1511 | $ cd follow |
|
1512 | 1512 | $ echo a > a |
|
1513 | $ echo aa > aa | |
|
1513 | 1514 | $ hg ci -Am "add a" |
|
1514 | 1515 | adding a |
|
1516 | adding aa | |
|
1515 | 1517 | $ hg cp a b |
|
1516 | 1518 | $ hg ci -m "copy a b" |
|
1517 | 1519 | $ mkdir dir |
@@ -1549,3 +1551,14 b' Test multiple --include/--exclude/paths' | |||
|
1549 | 1551 | |
|
1550 | 1552 | $ testlog --include a --include e --exclude b --exclude e a e |
|
1551 | 1553 | ('group', ('group', ('func', ('symbol', '_matchfiles'), ('list', ('list', ('list', ('list', ('list', ('string', 'p:a'), ('string', 'p:e')), ('string', 'i:a')), ('string', 'i:e')), ('string', 'x:b')), ('string', 'x:e'))))) |
|
1554 | ||
|
1555 | Test glob expansion of pats | |
|
1556 | ||
|
1557 | $ expandglobs=`python -c "import mercurial.util; \ | |
|
1558 | > print mercurial.util.expandglobs and 'true' or 'false'"` | |
|
1559 | $ if [ $expandglobs = "true" ]; then | |
|
1560 | > testlog 'a*'; | |
|
1561 | > else | |
|
1562 | > testlog a*; | |
|
1563 | > fi; | |
|
1564 | ('group', ('group', ('func', ('symbol', 'filelog'), ('string', 'aa')))) |
General Comments 0
You need to be logged in to leave comments.
Login now