bundle2: introduce a ReadOnlyPartError exception
authorPierre-Yves David <pierre-yves.david@fb.com>
Sat, 24 May 2014 16:08:05 -0700
changeset 21603 31be5a6fa716
parent 21602 cc33ae50bab3
child 21604 c399bf961cb9
bundle2: introduce a ReadOnlyPartError exception As we will introduce functions to alter already created parts, we need a proper exception to raise when code tries to alter a part that cannot be altered anymore.
mercurial/bundle2.py
--- a/mercurial/bundle2.py	Fri May 23 16:20:30 2014 -0700
+++ b/mercurial/bundle2.py	Sat May 24 16:08:05 2014 -0700
@@ -174,6 +174,10 @@
     """error raised when no handler is found for a Mandatory part"""
     pass
 
+class ReadOnlyPartError(RuntimeError):
+    """error raised when code tries to alter a part being generated"""
+    pass
+
 parthandlermapping = {}
 
 def parthandler(parttype):