/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/merge_directive.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-13 23:57:28 UTC
  • mfrom: (7490 work)
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200213235728-m6ds0mm3mbs4y182
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
 
18
 
17
19
import base64
18
20
import contextlib
19
21
from io import BytesIO
45
47
    )
46
48
 
47
49
 
48
 
class IllegalMergeDirectivePayload(errors.BzrError):
49
 
    """A merge directive contained something other than a patch or bundle"""
50
 
 
51
 
    _fmt = "Bad merge directive payload %(start)r"
52
 
 
53
 
    def __init__(self, start):
54
 
        errors.BzrError(self)
55
 
        self.start = start
56
 
 
57
 
 
58
50
class MergeRequestBodyParams(object):
59
51
    """Parameter object for the merge_request_body hook."""
60
52
 
552
544
                if start.startswith(b'# Begin bundle'):
553
545
                    bundle = b''.join(line_iter)
554
546
                else:
555
 
                    raise IllegalMergeDirectivePayload(start)
 
547
                    raise errors.IllegalMergeDirectivePayload(start)
556
548
        time, timezone = timestamp.parse_patch_date(stanza.get('timestamp'))
557
549
        kwargs = {}
558
550
        for key in ('revision_id', 'testament_sha1', 'target_branch',