# HG changeset patch # User Joerg Sonnenberger # Date 2021-01-26 22:56:11 # Node ID 9f8f0df391c78a7b1941e6feede155320760ad7a # Parent fb0ad038811dc39fb13ae02f0a5fb1f89d0cd0a4 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 diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -2145,7 +2145,7 @@ class revlog(object): dfh = self._datafp(b"a+") ifh = self._indexfp(b"a+") try: - return self._addrevision( + self._addrevision( node, rawtext, transaction, @@ -2158,6 +2158,7 @@ class revlog(object): dfh, deltacomputer=deltacomputer, ) + return node finally: if dfh: dfh.close() @@ -2329,7 +2330,7 @@ class revlog(object): 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