Patchwork D699: revlog: refactor chain variable

login
register
mail settings
Submitter phabricator
Date Sept. 13, 2017, 6:18 p.m.
Message ID <93e7d044e1820765d3ce50397bfb44fb@localhost.localdomain>
Download mbox | patch
Permalink /patch/23869/
State Not Applicable
Headers show

Comments

phabricator - Sept. 13, 2017, 6:18 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb96cfc309ac5: revlog: refactor chain variable (authored by durham, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D699?vs=1787&id=1789

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: durham, indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1916,11 +1916,11 @@ 
                 flags = chunkdata['flags'] or REVIDX_DEFAULT_FLAGS
 
                 nodes.append(node)
+                chain = node
 
                 link = linkmapper(cs)
                 if node in self.nodemap:
                     # this can happen if two branches make the same change
-                    chain = node
                     continue
 
                 for p in (p1, p2):
@@ -1954,13 +1954,13 @@ 
                 # We're only using addgroup() in the context of changegroup
                 # generation so the revision data can always be handled as raw
                 # by the flagprocessor.
-                chain = self._addrevision(node, None, transaction, link,
-                                          p1, p2, flags, (baserev, delta),
-                                          ifh, dfh,
-                                          alwayscache=bool(addrevisioncb))
+                self._addrevision(node, None, transaction, link,
+                                  p1, p2, flags, (baserev, delta),
+                                  ifh, dfh,
+                                  alwayscache=bool(addrevisioncb))
 
                 if addrevisioncb:
-                    addrevisioncb(self, chain)
+                    addrevisioncb(self, node)
 
                 if not dfh and not self._inline:
                     # addrevision switched from inline to conventional