diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py --- a/mercurial/logcmdutil.py +++ b/mercurial/logcmdutil.py @@ -74,6 +74,9 @@ ui.warn(_('warning: %s not inside relative root %s\n') % ( match.uipath(matchroot), uirelroot)) + relrootmatch = scmutil.match(ctx2, pats=[relroot], default='path') + match = matchmod.intersectmatchers(match, relrootmatch) + if stat: diffopts = diffopts.copy(context=0, noprefix=False) width = 80 diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -32,7 +32,6 @@ encoding, error, mail, - match as matchmod, mdiff, pathutil, pycompat, @@ -2320,10 +2319,6 @@ return getfilectx getfilectx = lrugetfilectx() - if relroot: - relrootmatch = scmutil.match(ctx2, pats=[relroot], default='path') - match = matchmod.intersectmatchers(match, relrootmatch) - if not changes: changes = ctx1.status(ctx2, match=match) modified, added, removed = changes[:3]