changeset 21900:b8bd97085ec9

bundle2: add a ``bundle20.nbparts`` property This property can be used to know how much parts have been added to the bundle2. This will be useful to check if any part have been generated for a push.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 02 Jul 2014 16:17:54 +0200
parents 52ab44b979f4
children 8612c4ab7f54
files mercurial/bundle2.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Wed Jul 02 11:42:35 2014 +0200
+++ b/mercurial/bundle2.py	Wed Jul 02 16:17:54 2014 +0200
@@ -395,6 +395,11 @@
         self._parts = []
         self.capabilities = dict(capabilities)
 
+    @property
+    def nbparts(self):
+        """total number of parts added to the bundler"""
+        return len(self._parts)
+
     # methods used to defines the bundle2 content
     def addparam(self, name, value=None):
         """add a stream level parameter"""