joerg.sonnenberger created this revision.
Herald added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -2150,7 +2150,7 @@
             dfh = self._datafp(b"a+")
         ifh = self._indexfp(b"a+")
         try:
-            return self._addrevision(
+            self._addrevision(
                 node,
                 rawtext,
                 transaction,
@@ -2163,6 +2163,7 @@
                 dfh,
                 deltacomputer=deltacomputer,
             )
+            return node
         finally:
             if dfh:
                 dfh.close()
@@ -2334,7 +2335,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



To: joerg.sonnenberger, indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to