Patchwork D1764: revlog: don't use slicing to return parents

login
register
mail settings
Submitter phabricator
Date Jan. 5, 2018, 6:17 a.m.
Message ID <ef04c1c7fcd557d449d02be1d77e83b1@localhost.localdomain>
Download mbox | patch
Permalink /patch/26557/
State Not Applicable
Headers show

Comments

phabricator - Jan. 5, 2018, 6:17 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa0fab647a8f1: revlog: don&#039;t use slicing to return parents (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1764?vs=4625&id=4702

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -622,12 +622,14 @@ 
 
     def parentrevs(self, rev):
         try:
-            return self.index[rev][5:7]
+            entry = self.index[rev]
         except IndexError:
             if rev == wdirrev:
                 raise error.WdirUnsupported
             raise
 
+        return entry[5], entry[6]
+
     def node(self, rev):
         try:
             return self.index[rev][7]