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