revlog: minor revdiff reorganization
authorMatt Mackall <mpm@selenic.com>
Thu, 26 Jul 2007 12:02:58 -0500
changeset 5005 72082bfced9a
parent 5004 825516d16b25
child 5006 c2febf5420e9
revlog: minor revdiff reorganization
mercurial/revlog.py
--- a/mercurial/revlog.py	Thu Jul 26 12:02:58 2007 -0500
+++ b/mercurial/revlog.py	Thu Jul 26 12:02:58 2007 -0500
@@ -885,13 +885,11 @@
 
     def revdiff(self, rev1, rev2):
         """return or calculate a delta between two revisions"""
-        b1 = self.base(rev1)
-        b2 = self.base(rev2)
-        if b1 == b2 and rev1 + 1 == rev2:
+        if rev1 + 1 == rev2 and self.base(rev1) == self.base(rev2):
             return self.chunk(rev2)
-        else:
-            return mdiff.textdiff(self.revision(self.node(rev1)),
-                                  self.revision(self.node(rev2)))
+
+        return mdiff.textdiff(self.revision(self.node(rev1)),
+                              self.revision(self.node(rev2)))
 
     def revision(self, node):
         """return an uncompressed revision of a given"""