diff -r 33020e87f8c5 -r dbbae63865a6 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sat Jul 12 20:07:24 2014 +0900 +++ b/mercurial/cmdutil.py Wed Jul 16 17:35:04 2014 -0500 @@ -1488,7 +1488,7 @@ return iterate() -def _makelogfilematcher(repo, pats, followfirst): +def _makelogfilematcher(repo, files, followfirst): # When displaying a revision with --patch --follow FILE, we have # to know which file of the revision must be diffed. With # --follow, we want the names of the ancestors of FILE in the @@ -1502,7 +1502,7 @@ wctx = repo[None] def populate(): - for fn in pats: + for fn in files: for i in ((pctx[fn],), pctx[fn].ancestors(followfirst=followfirst)): for c in i: fcache.setdefault(c.linkrev(), set()).add(c.path()) @@ -1627,7 +1627,9 @@ filematcher = None if opts.get('patch') or opts.get('stat'): if follow: - filematcher = _makelogfilematcher(repo, pats, followfirst) + # _makelogfilematcher expects its files argument to be relative to + # the repo root, so use match.files(), not pats. + filematcher = _makelogfilematcher(repo, match.files(), followfirst) else: filematcher = lambda rev: match