# HG changeset patch # User Pierre-Yves David # Date 1400972885 25200 # Node ID 31be5a6fa71644976fbad8eb71fdec9d0180f772 # Parent cc33ae50bab30d67d2bf1c219cfe5c64e19602e3 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. diff -r cc33ae50bab3 -r 31be5a6fa716 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):