Patchwork [3,of,5] bundlerepo: avoid unnecessary node -> rev conversion

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

Comments

Jun Wu - March 29, 2017, 11:57 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1490830080 25200
#      Wed Mar 29 16:28:00 2017 -0700
# Node ID 2d3258eca3f07d249991fcb14e6bfd9a687d07e2
# Parent  21926bb9a6adbadc1f715dc0a71ac53a3c4d8019
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 2d3258eca3f0
bundlerepo: avoid unnecessary node -> rev conversion

Patch

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -115,6 +115,5 @@  class bundlerevlog(revlog.revlog):
             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):
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
@@ -14,10 +14,4 @@  New errors are not allowed. Warnings are
    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':