unionrepo: avoid unnecessary node -> rev conversion
authorJun Wu <quark@fb.com>
Wed, 29 Mar 2017 16:28:51 -0700
changeset 31724 f1e0446e804c
parent 31723 2c4295773436
child 31725 c777b12cdc9b
unionrepo: avoid unnecessary node -> rev conversion
mercurial/unionrepo.py
tests/test-check-code.t
--- a/mercurial/unionrepo.py	Wed Mar 29 16:28:00 2017 -0700
+++ b/mercurial/unionrepo.py	Wed Mar 29 16:28:51 2017 -0700
@@ -90,8 +90,7 @@
         elif rev1 <= self.repotiprev and rev2 <= self.repotiprev:
             return self.baserevdiff(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:28:00 2017 -0700
+++ b/tests/test-check-code.t	Wed Mar 29 16:28:51 2017 -0700
@@ -40,12 +40,6 @@
    >     policy = os.environ.get('HGMODULEPOLICY', policy)
    use encoding.environ instead (py3)
   Skipping mercurial/statprof.py it has no-che?k-code (glob)
-  mercurial/unionrepo.py:93:
-   >         return mdiff.textdiff(self.revision(self.node(rev1)),
-   don't covert rev to node before passing to revision(nodeorrev)
-  mercurial/unionrepo.py:94:
-   >                               self.revision(self.node(rev2)))
-   don't covert rev to node before passing to revision(nodeorrev)
   [1]
 
 @commands in debugcommands.py should be in alphabetical order.