Patchwork D9881: revlog: change addrawrevision to return the revision

login
register
mail settings
Submitter phabricator
Date Jan. 27, 2021, 2:10 a.m.
Message ID <differential-rev-PHID-DREV-qhqwxkiacsufh2icnb7n-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48192/
State Superseded
Headers show

Comments

phabricator - Jan. 27, 2021, 2:10 a.m.
joerg.sonnenberger created this revision.
Herald added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9881

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: joerg.sonnenberger, indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -2117,7 +2117,7 @@ 
         if validatehash:
             self.checkhash(rawtext, node, p1=p1, p2=p2)
 
-        return self.addrawrevision(
+        rev = self.addrawrevision(
             rawtext,
             transaction,
             link,
@@ -2128,6 +2128,7 @@ 
             cachedelta=cachedelta,
             deltacomputer=deltacomputer,
         )
+        return node
 
     def addrawrevision(
         self,
@@ -2150,7 +2151,7 @@ 
             dfh = self._datafp(b"a+")
         ifh = self._indexfp(b"a+")
         try:
-            self._addrevision(
+            return self._addrevision(
                 node,
                 rawtext,
                 transaction,
@@ -2163,7 +2164,6 @@ 
                 dfh,
                 deltacomputer=deltacomputer,
             )
-            return node
         finally:
             if dfh:
                 dfh.close()