changeset 46506:07984507d553

revlog: change _addrevision to return the new revision The node is passed as argument already, so returning it is quite pointless. The revision number on the other is useful as it decouples the caller from the revlog internals. Differential Revision: https://phab.mercurial-scm.org/D9880
author Joerg Sonnenberger <joerg@bec.de>
date Tue, 26 Jan 2021 23:56:11 +0100
parents a25033eb43b5
children 9ee4e988e2be
files mercurial/revlog.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Mon Feb 08 23:41:58 2021 +0100
+++ b/mercurial/revlog.py	Tue Jan 26 23:56:11 2021 +0100
@@ -2145,7 +2145,7 @@
             dfh = self._datafp(b"a+")
         ifh = self._indexfp(b"a+")
         try:
-            return self._addrevision(
+            self._addrevision(
                 node,
                 rawtext,
                 transaction,
@@ -2158,6 +2158,7 @@
                 dfh,
                 deltacomputer=deltacomputer,
             )
+            return node
         finally:
             if dfh:
                 dfh.close()
@@ -2329,7 +2330,7 @@
         if type(rawtext) == bytes:  # only accept immutable objects
             self._revisioncache = (node, curr, rawtext)
         self._chainbasecache[curr] = deltainfo.chainbase
-        return node
+        return curr
 
     def _writeentry(self, transaction, ifh, dfh, entry, data, link, offset):
         # Files opened in a+ mode have inconsistent behavior on various