##// END OF EJS Templates
localrepo: allow narrowmatch() to accept matcher to intersect with...
Martin von Zweigbergk -
r40437:4fd0fac4 default
parent child Browse files
Show More
@@ -1271,8 +1271,7 def getbundler(version, repo, bundlecaps
1271
1271
1272 # Requested files could include files not in the local store. So
1272 # Requested files could include files not in the local store. So
1273 # filter those out.
1273 # filter those out.
1274 filematcher = matchmod.intersectmatchers(repo.narrowmatch(),
1274 filematcher = repo.narrowmatch(filematcher)
1275 filematcher)
1276
1275
1277 fn = _packermap[version][0]
1276 fn = _packermap[version][0]
1278 return fn(repo, filematcher, bundlecaps, ellipses=ellipses,
1277 return fn(repo, filematcher, bundlecaps, ellipses=ellipses,
@@ -44,7 +44,6 from . import (
44 help,
44 help,
45 hg,
45 hg,
46 logcmdutil,
46 logcmdutil,
47 match as matchmod,
48 merge as mergemod,
47 merge as mergemod,
49 narrowspec,
48 narrowspec,
50 obsolete,
49 obsolete,
@@ -1970,7 +1969,7 def diff(ui, repo, *pats, **opts):
1970
1969
1971 diffopts = patch.diffallopts(ui, opts)
1970 diffopts = patch.diffallopts(ui, opts)
1972 m = scmutil.match(ctx2, pats, opts)
1971 m = scmutil.match(ctx2, pats, opts)
1973 m = matchmod.intersectmatchers(m, repo.narrowmatch())
1972 m = repo.narrowmatch(m)
1974 ui.pager('diff')
1973 ui.pager('diff')
1975 logcmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat,
1974 logcmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat,
1976 listsubrepos=opts.get('subrepos'),
1975 listsubrepos=opts.get('subrepos'),
@@ -1200,8 +1200,14 class localrepository(object):
1200 include, exclude = self.narrowpats
1200 include, exclude = self.narrowpats
1201 return narrowspec.match(self.root, include=include, exclude=exclude)
1201 return narrowspec.match(self.root, include=include, exclude=exclude)
1202
1202
1203 # TODO(martinvonz): make this property-like instead?
1203 def narrowmatch(self, match=None):
1204 def narrowmatch(self):
1204 """matcher corresponding the the repo's narrowspec
1205
1206 If `match` is given, then that will be intersected with the narrow
1207 matcher.
1208 """
1209 if match:
1210 return matchmod.intersectmatchers(match, self._narrowmatch)
1205 return self._narrowmatch
1211 return self._narrowmatch
1206
1212
1207 def setnarrowpats(self, newincludes, newexcludes):
1213 def setnarrowpats(self, newincludes, newexcludes):
General Comments 0
You need to be logged in to leave comments. Login now