obsstore: have the `mergemarkers` method return the number of new markers
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 21 Aug 2014 17:42:50 -0700
changeset 22325 3363f2d36015
parent 22323 b31d29b2a7f2
child 22326 370b71622670
obsstore: have the `mergemarkers` method return the number of new markers The mergemarkers function now returns the number of unknown markers in the stream that have been added to the obsstore. This is similar to what `obsstore.add` already does. The method gains a docstring in the process.
mercurial/obsolete.py
--- a/mercurial/obsolete.py	Thu Aug 21 17:36:05 2014 -0700
+++ b/mercurial/obsolete.py	Thu Aug 21 17:42:50 2014 -0700
@@ -369,8 +369,11 @@
         return len(new)
 
     def mergemarkers(self, transaction, data):
+        """merge a binary stream of markers inside the obsstore
+
+        Returns the number of new markers added."""
         markers = _readmarkers(data)
-        self.add(transaction, markers)
+        return self.add(transaction, markers)
 
     def _load(self, markers):
         for mark in markers: