Patchwork [1,of,5] filectx.parents: also fetch the filelog of rename source too

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 30, 2014, 9:37 p.m.
Message ID <88ec1cc5c6f5b3281d46.1419975428@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/7263/
State Accepted
Commit fe17a6fb220dfbe3fd96fbae0d07ff31e29a435a
Headers show

Comments

Pierre-Yves David - Dec. 30, 2014, 9:37 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1419388246 28800
#      Tue Dec 23 18:30:46 2014 -0800
# Node ID 88ec1cc5c6f5b3281d46e440ba1e70dbf14d18eb
# Parent  fbd6a3fba78ade5c45495c933bf118389248c496
filectx.parents: also fetch the filelog of rename source too

we are going to need this filelog for the linkrev adjustment, so we better
normalise the list and have the filelog in all case.

This is done in a previous changeset to help readability.

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -747,11 +747,11 @@  class basefilectx(object):
             # the first one.
             #
             # As null id have alway been filtered out in the previous list
             # comprehension, inserting to 0 will always result in "replacing
             # first nullid parent with rename information.
-            pl.insert(0, (r[0], r[1], None))
+            pl.insert(0, (r[0], r[1], self._repo.file(r[0])))
 
         return [filectx(self._repo, p, fileid=n, filelog=l) for p, n, l in pl]
 
     def p1(self):
         return self.parents()[0]