Patchwork D1670: debugbuilddag: create filectx instance in 'filectxfn' callback

login
register
mail settings
Submitter phabricator
Date Dec. 13, 2017, 1:05 p.m.
Message ID <3df2e74a1c58f6b97c08a25499a74039@localhost.localdomain>
Download mbox | patch
Permalink /patch/26266/
State Not Applicable
Headers show

Comments

phabricator - Dec. 13, 2017, 1:05 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3efad47ea59f: debugbuilddag: create filectx instance in &#039;filectxfn&#039; callback (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1670?vs=4395&id=4417

REVISION DETAIL
  https://phab.mercurial-scm.org/D1670

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, yuja
Cc: mercurial-devel

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -183,7 +183,7 @@ 
                 id, ps = data
 
                 files = []
-                fctxs = {}
+                filecontent = {}
 
                 p2 = None
                 if mergeable_file:
@@ -204,27 +204,29 @@ 
                     ml[id * linesperrev] += " r%i" % id
                     mergedtext = "\n".join(ml)
                     files.append(fn)
-                    fctxs[fn] = context.memfilectx(repo, fn, mergedtext)
+                    filecontent[fn] = mergedtext
 
                 if overwritten_file:
                     fn = "of"
                     files.append(fn)
-                    fctxs[fn] = context.memfilectx(repo, fn, "r%i\n" % id)
+                    filecontent[fn] = "r%i\n" % id
 
                 if new_file:
                     fn = "nf%i" % id
                     files.append(fn)
-                    fctxs[fn] = context.memfilectx(repo, fn, "r%i\n" % id)
+                    filecontent[fn] = "r%i\n" % id
                     if len(ps) > 1:
                         if not p2:
                             p2 = repo[ps[1]]
                         for fn in p2:
                             if fn.startswith("nf"):
                                 files.append(fn)
-                                fctxs[fn] = p2[fn]
+                                filecontent[fn] = p2[fn].data()
 
                 def fctxfn(repo, cx, path):
-                    return fctxs.get(path)
+                    if path in filecontent:
+                        return context.memfilectx(repo, path, filecontent[path])
+                    return None
 
                 if len(ps) == 0 or ps[0] < 0:
                     pars = [None, None]