changeset 31727:4eb75c86368b

revlog: avoid unnecessary node -> rev conversion
author Jun Wu <quark@fb.com>
date Wed, 29 Mar 2017 16:23:04 -0700
parents be8a866a2c44
children 2c4295773436
files mercurial/revlog.py tests/test-check-code.t
diffstat 2 files changed, 3 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Wed Mar 29 16:46:57 2017 -0700
+++ b/mercurial/revlog.py	Wed Mar 29 16:23:04 2017 -0700
@@ -438,7 +438,7 @@
         if l >= 0:
             return l
 
-        t = self.revision(self.node(rev))
+        t = self.revision(rev)
         return len(t)
     size = rawsize
 
@@ -1596,7 +1596,7 @@
                     fh = ifh
                 else:
                     fh = dfh
-                basetext = self.revision(self.node(baserev), _df=fh, raw=raw)
+                basetext = self.revision(baserev, _df=fh, raw=raw)
                 btext[0] = mdiff.patch(basetext, delta)
 
             try:
@@ -1628,7 +1628,7 @@
                         fh = ifh
                     else:
                         fh = dfh
-                    ptext = self.revision(self.node(rev), _df=fh)
+                    ptext = self.revision(rev, _df=fh)
                     delta = mdiff.textdiff(ptext, t)
             header, data = self.compress(delta)
             deltalen = len(header) + len(data)
--- a/tests/test-check-code.t	Wed Mar 29 16:46:57 2017 -0700
+++ b/tests/test-check-code.t	Wed Mar 29 16:23:04 2017 -0700
@@ -45,15 +45,6 @@
   mercurial/policy.py:49:
    >     policy = os.environ.get('HGMODULEPOLICY', policy)
    use encoding.environ instead (py3)
-  mercurial/revlog.py:441:
-   >         t = self.revision(self.node(rev))
-   don't covert rev to node before passing to revision(nodeorrev)
-  mercurial/revlog.py:1599:
-   >                 basetext = self.revision(self.node(baserev), _df=fh, raw=raw)
-   don't covert rev to node before passing to revision(nodeorrev)
-  mercurial/revlog.py:1631:
-   >                     ptext = self.revision(self.node(rev), _df=fh)
-   don't covert rev to node before passing to revision(nodeorrev)
   Skipping mercurial/statprof.py it has no-che?k-code (glob)
   mercurial/unionrepo.py:93:
    >         return mdiff.textdiff(self.revision(self.node(rev1)),