changeset 21602:cc33ae50bab3

bundle2: warn about error during initialization in ``newpart`` docstring As we are moving toward being able to alter a part after its creation, we need to make the implication of the part being already part of the bundle2 clear.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 23 May 2014 16:20:30 -0700
parents 7ff01befc7ec
children 31be5a6fa716
files mercurial/bundle2.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Thu May 22 11:14:02 2014 -0700
+++ b/mercurial/bundle2.py	Fri May 23 16:20:30 2014 -0700
@@ -408,7 +408,14 @@
         self._parts.append(part)
 
     def newpart(self, typeid, *args, **kwargs):
-        """create a new part and add it to the containers"""
+        """create a new part and add it to the containers
+
+        As the part is directly added to the containers. For now, this means
+        that any failure to properly initialize the part after calling
+        ``newpart`` should result in a failure of the whole bundling process.
+
+        You can still fall back to manually create and add if you need better
+        control."""
         part = bundlepart(typeid, *args, **kwargs)
         self.addpart(part)
         return part