Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 22167:d4bc38f6eab7 stable
cmdutil: add a hook for making custom non-follow log file matchers
This will be used by largefiles (and basically only by largefiles) in an
upcoming patch.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Wed, 13 Aug 2014 15:17:03 -0700 |
parents | ac7a3b2a85e3 |
children | d3702a822241 f6371cc62d2a |
comparison
equal
deleted
inserted
replaced
22166:ac7a3b2a85e3 | 22167:d4bc38f6eab7 |
---|---|
1517 populate() | 1517 populate() |
1518 return scmutil.matchfiles(repo, fcache.get(rev, [])) | 1518 return scmutil.matchfiles(repo, fcache.get(rev, [])) |
1519 | 1519 |
1520 return filematcher | 1520 return filematcher |
1521 | 1521 |
1522 def _makenofollowlogfilematcher(repo, pats, opts): | |
1523 '''hook for extensions to override the filematcher for non-follow cases''' | |
1524 return None | |
1525 | |
1522 def _makelogrevset(repo, pats, opts, revs): | 1526 def _makelogrevset(repo, pats, opts, revs): |
1523 """Return (expr, filematcher) where expr is a revset string built | 1527 """Return (expr, filematcher) where expr is a revset string built |
1524 from log options and file patterns or None. If --stat or --patch | 1528 from log options and file patterns or None. If --stat or --patch |
1525 are not passed filematcher is None. Otherwise it is a callable | 1529 are not passed filematcher is None. Otherwise it is a callable |
1526 taking a revision number and returning a match objects filtering | 1530 taking a revision number and returning a match objects filtering |
1633 # _makelogfilematcher expects its files argument to be relative to | 1637 # _makelogfilematcher expects its files argument to be relative to |
1634 # the repo root, so use match.files(), not pats. | 1638 # the repo root, so use match.files(), not pats. |
1635 filematcher = _makefollowlogfilematcher(repo, match.files(), | 1639 filematcher = _makefollowlogfilematcher(repo, match.files(), |
1636 followfirst) | 1640 followfirst) |
1637 else: | 1641 else: |
1638 filematcher = lambda rev: match | 1642 filematcher = _makenofollowlogfilematcher(repo, pats, opts) |
1643 if filematcher is None: | |
1644 filematcher = lambda rev: match | |
1639 | 1645 |
1640 expr = [] | 1646 expr = [] |
1641 for op, val in opts.iteritems(): | 1647 for op, val in opts.iteritems(): |
1642 if not val: | 1648 if not val: |
1643 continue | 1649 continue |