bundlerepo: avoid unnecessary node -> rev conversion
authorJun Wu <quark@fb.com>
Wed, 29 Mar 2017 16:28:00 -0700
changeset 31728 2c4295773436
parent 31727 4eb75c86368b
child 31729 f1e0446e804c
bundlerepo: avoid unnecessary node -> rev conversion
mercurial/bundlerepo.py
tests/test-check-code.t
--- 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)