revlog: change addrawrevision to return the revision
authorJoerg Sonnenberger <joerg@bec.de>
Wed, 27 Jan 2021 00:55:20 +0100
changeset 46559 9ee4e988e2be
parent 46558 07984507d553
child 46560 f7b61ad3c64a
revlog: change addrawrevision to return the revision Differential Revision: https://phab.mercurial-scm.org/D9881
mercurial/revlog.py
--- a/mercurial/revlog.py	Tue Jan 26 23:56:11 2021 +0100
+++ b/mercurial/revlog.py	Wed Jan 27 00:55:20 2021 +0100
@@ -2112,7 +2112,7 @@
         if validatehash:
             self.checkhash(rawtext, node, p1=p1, p2=p2)
 
-        return self.addrawrevision(
+        rev = self.addrawrevision(
             rawtext,
             transaction,
             link,
@@ -2123,6 +2123,7 @@
             cachedelta=cachedelta,
             deltacomputer=deltacomputer,
         )
+        return node
 
     def addrawrevision(
         self,
@@ -2145,7 +2146,7 @@
             dfh = self._datafp(b"a+")
         ifh = self._indexfp(b"a+")
         try:
-            self._addrevision(
+            return self._addrevision(
                 node,
                 rawtext,
                 transaction,
@@ -2158,7 +2159,6 @@
                 dfh,
                 deltacomputer=deltacomputer,
             )
-            return node
         finally:
             if dfh:
                 dfh.close()