[PATCH 4 of 5] unionrepo: avoid unnecessary node -> rev conversion

Jun Wu quark at fb.com
Wed Mar 29 19:57:37 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1490830131 25200
#      Wed Mar 29 16:28:51 2017 -0700
# Node ID 265ea657d75905fb59a27194a75aaff49be94598
# Parent  2d3258eca3f07d249991fcb14e6bfd9a687d07e2
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 265ea657d759
unionrepo: avoid unnecessary node -> rev conversion

diff --git a/mercurial/unionrepo.py b/mercurial/unionrepo.py
--- a/mercurial/unionrepo.py
+++ b/mercurial/unionrepo.py
@@ -91,6 +91,5 @@ class unionrevlog(revlog.revlog):
             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):
diff --git a/tests/test-check-code.t b/tests/test-check-code.t
--- a/tests/test-check-code.t
+++ b/tests/test-check-code.t
@@ -41,10 +41,4 @@ New errors are not allowed. Warnings are
    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]
 


More information about the Mercurial-devel mailing list