##// END OF EJS Templates
patch: let caller pass in root-filtering matcher (API)...
Martin von Zweigbergk -
r41768:035cae1d default
parent child Browse files
Show More
@@ -74,6 +74,9 b' def diffordiffstat(ui, repo, diffopts, n'
74 ui.warn(_('warning: %s not inside relative root %s\n') % (
74 ui.warn(_('warning: %s not inside relative root %s\n') % (
75 match.uipath(matchroot), uirelroot))
75 match.uipath(matchroot), uirelroot))
76
76
77 relrootmatch = scmutil.match(ctx2, pats=[relroot], default='path')
78 match = matchmod.intersectmatchers(match, relrootmatch)
79
77 if stat:
80 if stat:
78 diffopts = diffopts.copy(context=0, noprefix=False)
81 diffopts = diffopts.copy(context=0, noprefix=False)
79 width = 80
82 width = 80
@@ -32,7 +32,6 b' from . import ('
32 encoding,
32 encoding,
33 error,
33 error,
34 mail,
34 mail,
35 match as matchmod,
36 mdiff,
35 mdiff,
37 pathutil,
36 pathutil,
38 pycompat,
37 pycompat,
@@ -2320,10 +2319,6 b' def diffhunks(repo, ctx1, ctx2, match=No'
2320 return getfilectx
2319 return getfilectx
2321 getfilectx = lrugetfilectx()
2320 getfilectx = lrugetfilectx()
2322
2321
2323 if relroot:
2324 relrootmatch = scmutil.match(ctx2, pats=[relroot], default='path')
2325 match = matchmod.intersectmatchers(match, relrootmatch)
2326
2327 if not changes:
2322 if not changes:
2328 changes = ctx1.status(ctx2, match=match)
2323 changes = ctx1.status(ctx2, match=match)
2329 modified, added, removed = changes[:3]
2324 modified, added, removed = changes[:3]
General Comments 0
You need to be logged in to leave comments. Login now