changeset 22325:3363f2d36015

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 21 Aug 2014 17:42:50 -0700
parents b31d29b2a7f2
children 370b71622670
files mercurial/obsolete.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: