changeset 31728:2c4295773436

bundlerepo: avoid unnecessary node -> rev conversion
author Jun Wu <quark@fb.com>
date Wed, 29 Mar 2017 16:28:00 -0700
parents 4eb75c86368b
children f1e0446e804c
files mercurial/bundlerepo.py tests/test-check-code.t
diffstat 2 files changed, 1 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Wed Mar 29 16:23:04 2017 -0700
+++ b/mercurial/bundlerepo.py	Wed Mar 29 16:28:00 2017 -0700
@@ -114,8 +114,7 @@
         elif rev1 <= self.repotiprev and rev2 <= self.repotiprev:
             return revlog.revlog.revdiff(self, rev1, rev2)
 
-        return mdiff.textdiff(self.revision(self.node(rev1)),
-                              self.revision(self.node(rev2)))
+        return mdiff.textdiff(self.revision(rev1), self.revision(rev2))
 
     def revision(self, nodeorrev, raw=False):
         """return an uncompressed revision of a given node or revision
--- a/tests/test-check-code.t	Wed Mar 29 16:23:04 2017 -0700
+++ b/tests/test-check-code.t	Wed Mar 29 16:28:00 2017 -0700
@@ -13,12 +13,6 @@
    >             r.revision(r.node(x))
    don't covert rev to node before passing to revision(nodeorrev)
   Skipping i18n/polib.py it has no-che?k-code (glob)
-  mercurial/bundlerepo.py:117:
-   >         return mdiff.textdiff(self.revision(self.node(rev1)),
-   don't covert rev to node before passing to revision(nodeorrev)
-  mercurial/bundlerepo.py:118:
-   >                               self.revision(self.node(rev2)))
-   don't covert rev to node before passing to revision(nodeorrev)
   mercurial/demandimport.py:312:
    >     if os.environ.get('HGDEMANDIMPORT') != 'disable':
    use encoding.environ instead (py3)