changeset 31729:f1e0446e804c

unionrepo: avoid unnecessary node -> rev conversion
author Jun Wu <quark@fb.com>
date Wed, 29 Mar 2017 16:28:51 -0700
parents 2c4295773436
children c777b12cdc9b
files mercurial/unionrepo.py tests/test-check-code.t
diffstat 2 files changed, 1 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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.