# HG changeset patch # User Yuya Nishihara # Date 1474714322 -32400 # Node ID 96b2dd3b184d8a9e169698dd7b3723d7062dd5a4 # Parent d34cf260d15b4a69d92a19d4419c1113f436912c log: unroll loop that populates file paths for --patch --follow matcher We can't handle the first fctx in the same manner as its ancestors. Also, I think the original code was too tricky. diff -r d34cf260d15b -r 96b2dd3b184d mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sun Sep 25 12:20:31 2016 -0700 +++ b/mercurial/cmdutil.py Sat Sep 24 19:52:02 2016 +0900 @@ -1949,9 +1949,10 @@ def populate(): 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()) + fctx = pctx[fn] + fcache.setdefault(fctx.linkrev(), set()).add(fctx.path()) + for c in fctx.ancestors(followfirst=followfirst): + fcache.setdefault(c.linkrev(), set()).add(c.path()) def filematcher(rev): if not fcacheready[0]: