202 else: |
202 else: |
203 ml = initialmergedlines |
203 ml = initialmergedlines |
204 ml[id * linesperrev] += " r%i" % id |
204 ml[id * linesperrev] += " r%i" % id |
205 mergedtext = "\n".join(ml) |
205 mergedtext = "\n".join(ml) |
206 files.append(fn) |
206 files.append(fn) |
207 fctxs[fn] = context.memfilectx(repo, fn, mergedtext) |
207 filecontent[fn] = mergedtext |
208 |
208 |
209 if overwritten_file: |
209 if overwritten_file: |
210 fn = "of" |
210 fn = "of" |
211 files.append(fn) |
211 files.append(fn) |
212 fctxs[fn] = context.memfilectx(repo, fn, "r%i\n" % id) |
212 filecontent[fn] = "r%i\n" % id |
213 |
213 |
214 if new_file: |
214 if new_file: |
215 fn = "nf%i" % id |
215 fn = "nf%i" % id |
216 files.append(fn) |
216 files.append(fn) |
217 fctxs[fn] = context.memfilectx(repo, fn, "r%i\n" % id) |
217 filecontent[fn] = "r%i\n" % id |
218 if len(ps) > 1: |
218 if len(ps) > 1: |
219 if not p2: |
219 if not p2: |
220 p2 = repo[ps[1]] |
220 p2 = repo[ps[1]] |
221 for fn in p2: |
221 for fn in p2: |
222 if fn.startswith("nf"): |
222 if fn.startswith("nf"): |
223 files.append(fn) |
223 files.append(fn) |
224 fctxs[fn] = p2[fn] |
224 filecontent[fn] = p2[fn].data() |
225 |
225 |
226 def fctxfn(repo, cx, path): |
226 def fctxfn(repo, cx, path): |
227 return fctxs.get(path) |
227 if path in filecontent: |
|
228 return context.memfilectx(repo, path, filecontent[path]) |
|
229 return None |
228 |
230 |
229 if len(ps) == 0 or ps[0] < 0: |
231 if len(ps) == 0 or ps[0] < 0: |
230 pars = [None, None] |
232 pars = [None, None] |
231 elif len(ps) == 1: |
233 elif len(ps) == 1: |
232 pars = [nodeids[ps[0]], None] |
234 pars = [nodeids[ps[0]], None] |