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

login
register
mail settings
Submitter Jun Wu
Date March 29, 2017, 11:57 p.m.
Message ID <265ea657d75905fb59a2.1490831857@x1c>
Download mbox | patch
Permalink /patch/19837/
State Accepted
Headers show

Comments

Jun Wu - March 29, 2017, 11:57 p.m.
# HG changeset patch
# User Jun Wu <quark@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

Patch

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]