/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 bzrlib/merge_directive.py

  • Committer: John Ferlito
  • Date: 2009-09-02 04:31:45 UTC
  • mto: (4665.7.1 serve-init)
  • mto: This revision was merged to the branch mainline in revision 4913.
  • Revision ID: johnf@inodes.org-20090902043145-gxdsfw03ilcwbyn5
Add a debian init script for bzr --serve

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2011 Canonical Ltd
 
1
# Copyright (C) 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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
 
import base64
18
 
import contextlib
19
 
from io import BytesIO
 
17
 
 
18
from StringIO import StringIO
20
19
import re
21
20
 
22
 
from . import lazy_import
23
 
lazy_import.lazy_import(globals(), """
24
 
from breezy import (
 
21
from bzrlib import (
25
22
    branch as _mod_branch,
26
23
    diff,
27
 
    email_message,
 
24
    errors,
28
25
    gpg,
29
26
    hooks,
30
27
    registry,
31
28
    revision as _mod_revision,
32
29
    rio,
 
30
    testament,
33
31
    timestamp,
34
32
    trace,
35
33
    )
36
 
from breezy.bzr import (
37
 
    testament,
38
 
    )
39
 
from breezy.bzr.bundle import (
 
34
from bzrlib.bundle import (
40
35
    serializer as bundle_serializer,
41
36
    )
42
 
""")
43
 
from . import (
44
 
    errors,
45
 
    )
46
 
 
47
 
 
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
 
37
from bzrlib.email_message import EmailMessage
56
38
 
57
39
 
58
40
class MergeRequestBodyParams(object):
74
56
    """Hooks for MergeDirective classes."""
75
57
 
76
58
    def __init__(self):
77
 
        hooks.Hooks.__init__(self, "breezy.merge_directive",
78
 
                             "BaseMergeDirective.hooks")
79
 
        self.add_hook(
80
 
            'merge_request_body',
 
59
        hooks.Hooks.__init__(self)
 
60
        self.create_hook(hooks.HookPoint('merge_request_body',
81
61
            "Called with a MergeRequestBodyParams when a body is needed for"
82
62
            " a merge request.  Callbacks must return a body.  If more"
83
63
            " than one callback is registered, the output of one callback is"
84
 
            " provided to the next.", (1, 15, 0))
85
 
 
86
 
 
87
 
class BaseMergeDirective(object):
88
 
    """A request to perform a merge into a branch.
89
 
 
90
 
    This is the base class that all merge directive implementations
91
 
    should derive from.
92
 
 
93
 
    :cvar multiple_output_files: Whether or not this merge directive
94
 
        stores a set of revisions in more than one file
95
 
    """
 
64
            " provided to the next.", (1, 15, 0), False))
 
65
 
 
66
 
 
67
class _BaseMergeDirective(object):
96
68
 
97
69
    hooks = MergeDirectiveHooks()
98
70
 
99
 
    multiple_output_files = False
100
 
 
101
71
    def __init__(self, revision_id, testament_sha1, time, timezone,
102
 
                 target_branch, patch=None, source_branch=None,
103
 
                 message=None, bundle=None):
 
72
                 target_branch, patch=None, source_branch=None, message=None,
 
73
                 bundle=None):
104
74
        """Constructor.
105
75
 
106
76
        :param revision_id: The revision to merge
108
78
            merge.
109
79
        :param time: The current POSIX timestamp time
110
80
        :param timezone: The timezone offset
111
 
        :param target_branch: Location of branch to apply the merge to
 
81
        :param target_branch: The branch to apply the merge to
112
82
        :param patch: The text of a diff or bundle
113
83
        :param source_branch: A public location to merge the revision from
114
84
        :param message: The message to use when committing this merge
122
92
        self.source_branch = source_branch
123
93
        self.message = message
124
94
 
125
 
    def to_lines(self):
126
 
        """Serialize as a list of lines
127
 
 
128
 
        :return: a list of lines
129
 
        """
130
 
        raise NotImplementedError(self.to_lines)
131
 
 
132
 
    def to_files(self):
133
 
        """Serialize as a set of files.
134
 
 
135
 
        :return: List of tuples with filename and contents as lines
136
 
        """
137
 
        raise NotImplementedError(self.to_files)
138
 
 
139
 
    def get_raw_bundle(self):
140
 
        """Return the bundle for this merge directive.
141
 
 
142
 
        :return: bundle text or None if there is no bundle
143
 
        """
144
 
        return None
145
 
 
146
95
    def _to_lines(self, base_revision=False):
147
96
        """Serialize as a list of lines
148
97
 
157
106
                stanza.add(key, self.__dict__[key])
158
107
        if base_revision:
159
108
            stanza.add('base_revision_id', self.base_revision_id)
160
 
        lines = [b'# ' + self._format_string + b'\n']
 
109
        lines = ['# ' + self._format_string + '\n']
161
110
        lines.extend(rio.to_patch_lines(stanza))
162
 
        lines.append(b'# \n')
 
111
        lines.append('# \n')
163
112
        return lines
164
113
 
165
 
    def write_to_directory(self, path):
166
 
        """Write this merge directive to a series of files in a directory.
167
 
 
168
 
        :param path: Filesystem path to write to
169
 
        """
170
 
        raise NotImplementedError(self.write_to_directory)
171
 
 
172
114
    @classmethod
173
115
    def from_objects(klass, repository, revision_id, time, timezone,
174
 
                     target_branch, patch_type='bundle',
175
 
                     local_target_branch=None, public_branch=None, message=None):
 
116
                 target_branch, patch_type='bundle',
 
117
                 local_target_branch=None, public_branch=None, message=None):
176
118
        """Generate a merge directive from various objects
177
119
 
178
120
        :param repository: The repository containing the revision
182
124
        :param target_branch: The url of the branch to merge into
183
125
        :param patch_type: 'bundle', 'diff' or None, depending on the type of
184
126
            patch desired.
185
 
        :param local_target_branch: the submit branch, either itself or a local copy
186
 
        :param public_branch: location of a public branch containing
187
 
            the target revision.
 
127
        :param local_target_branch: a local copy of the target branch
 
128
        :param public_branch: location of a public branch containing the target
 
129
            revision.
188
130
        :param message: Message to use when committing the merge
189
131
        :return: The merge directive
190
132
 
198
140
        if revision_id == _mod_revision.NULL_REVISION:
199
141
            t_revision_id = None
200
142
        t = testament.StrictTestament3.from_revision(repository, t_revision_id)
201
 
        if local_target_branch is None:
202
 
            submit_branch = _mod_branch.Branch.open(target_branch)
203
 
        else:
204
 
            submit_branch = local_target_branch
 
143
        submit_branch = _mod_branch.Branch.open(target_branch)
205
144
        if submit_branch.get_public_branch() is not None:
206
145
            target_branch = submit_branch.get_public_branch()
207
146
        if patch_type is None:
215
154
                                                submit_revision_id)
216
155
            type_handler = {'bundle': klass._generate_bundle,
217
156
                            'diff': klass._generate_diff,
218
 
                            None: lambda x, y, z: None}
 
157
                            None: lambda x, y, z: None }
219
158
            patch = type_handler[patch_type](repository, revision_id,
220
159
                                             ancestor_id)
221
160
 
226
165
                                                   revision_id)
227
166
 
228
167
        return klass(revision_id, t.as_sha1(), time, timezone, target_branch,
229
 
                     patch, patch_type, public_branch, message)
 
168
            patch, patch_type, public_branch, message)
230
169
 
231
170
    def get_disk_name(self, branch):
232
171
        """Generate a suitable basename for storing this directive on disk
238
177
        if self.revision_id == revision_id:
239
178
            revno = [revno]
240
179
        else:
241
 
            try:
242
 
                revno = branch.revision_id_to_dotted_revno(self.revision_id)
243
 
            except errors.NoSuchRevision:
244
 
                revno = ['merge']
245
 
        nick = re.sub('(\\W+)', '-', branch.nick).strip('-')
 
180
            revno = branch.get_revision_id_to_revno_map().get(self.revision_id,
 
181
                ['merge'])
 
182
        nick = re.sub('(\W+)', '-', branch.nick).strip('-')
246
183
        return '%s-%s' % (nick, '.'.join(str(n) for n in revno))
247
184
 
248
185
    @staticmethod
249
186
    def _generate_diff(repository, revision_id, ancestor_id):
250
187
        tree_1 = repository.revision_tree(ancestor_id)
251
188
        tree_2 = repository.revision_tree(revision_id)
252
 
        s = BytesIO()
 
189
        s = StringIO()
253
190
        diff.show_diff_trees(tree_1, tree_2, s, old_label='', new_label='')
254
191
        return s.getvalue()
255
192
 
256
193
    @staticmethod
257
194
    def _generate_bundle(repository, revision_id, ancestor_id):
258
 
        s = BytesIO()
 
195
        s = StringIO()
259
196
        bundle_serializer.write_bundle(repository, revision_id,
260
197
                                       ancestor_id, s)
261
198
        return s.getvalue()
266
203
        :param branch: The source branch, to get the signing strategy
267
204
        :return: a string
268
205
        """
269
 
        my_gpg = gpg.GPGStrategy(branch.get_config_stack())
270
 
        return my_gpg.sign(b''.join(self.to_lines()), gpg.MODE_CLEAR)
 
206
        my_gpg = gpg.GPGStrategy(branch.get_config())
 
207
        return my_gpg.sign(''.join(self.to_lines()))
271
208
 
272
209
    def to_email(self, mail_to, branch, sign=False):
273
210
        """Serialize as an email message.
278
215
        :param sign: If True, gpg-sign the email
279
216
        :return: an email message
280
217
        """
281
 
        mail_from = branch.get_config_stack().get('email')
 
218
        mail_from = branch.get_config().username()
282
219
        if self.message is not None:
283
220
            subject = self.message
284
221
        else:
287
224
        if sign:
288
225
            body = self.to_signed(branch)
289
226
        else:
290
 
            body = b''.join(self.to_lines())
291
 
        message = email_message.EmailMessage(mail_from, mail_to, subject,
292
 
                                             body)
 
227
            body = ''.join(self.to_lines())
 
228
        message = EmailMessage(mail_from, mail_to, subject, body)
293
229
        return message
294
230
 
295
231
    def install_revisions(self, target_repo):
297
233
        if not target_repo.has_revision(self.revision_id):
298
234
            if self.patch_type == 'bundle':
299
235
                info = bundle_serializer.read_bundle(
300
 
                    BytesIO(self.get_raw_bundle()))
 
236
                    StringIO(self.get_raw_bundle()))
301
237
                # We don't use the bundle's target revision, because
302
238
                # MergeDirective.revision_id is authoritative.
303
239
                try:
315
251
                                           info.real_revisions)
316
252
                    for revision in info.real_revisions:
317
253
                        for parent_id in revision.parent_ids:
318
 
                            if (parent_id not in bundle_revisions
319
 
                                    and not target_repo.has_revision(parent_id)):
 
254
                            if (parent_id not in bundle_revisions and
 
255
                                not target_repo.has_revision(parent_id)):
320
256
                                missing_revisions.append(parent_id)
321
257
                    # reverse missing revisions to try to get heads first
322
258
                    unique_missing = []
361
297
        elif len(self.hooks['merge_request_body']) > 0:
362
298
            trace.warning('Cannot run merge_request_body hooks because mail'
363
299
                          ' client %s does not support message bodies.',
364
 
                          mail_client.__class__.__name__)
 
300
                        mail_client.__class__.__name__)
365
301
        mail_client.compose_merge_request(to, subject,
366
 
                                          b''.join(self.to_lines()),
 
302
                                          ''.join(self.to_lines()),
367
303
                                          basename, body)
368
304
 
369
305
 
370
 
class MergeDirective(BaseMergeDirective):
 
306
class MergeDirective(_BaseMergeDirective):
371
307
 
372
308
    """A request to perform a merge into a branch.
373
309
 
383
319
    directly using the standard patch program.
384
320
    """
385
321
 
386
 
    _format_string = b'Bazaar merge directive format 1'
 
322
    _format_string = 'Bazaar merge directive format 1'
387
323
 
388
324
    def __init__(self, revision_id, testament_sha1, time, timezone,
389
325
                 target_branch, patch=None, patch_type=None,
395
331
            merge.
396
332
        :param time: The current POSIX timestamp time
397
333
        :param timezone: The timezone offset
398
 
        :param target_branch: Location of the branch to apply the merge to
 
334
        :param target_branch: The branch to apply the merge to
399
335
        :param patch: The text of a diff or bundle
400
336
        :param patch_type: None, "diff" or "bundle", depending on the contents
401
337
            of patch
402
338
        :param source_branch: A public location to merge the revision from
403
339
        :param message: The message to use when committing this merge
404
340
        """
405
 
        BaseMergeDirective.__init__(self, revision_id, testament_sha1, time,
406
 
                                    timezone, target_branch, patch, source_branch, message)
 
341
        _BaseMergeDirective.__init__(self, revision_id, testament_sha1, time,
 
342
            timezone, target_branch, patch, source_branch, message)
407
343
        if patch_type not in (None, 'diff', 'bundle'):
408
344
            raise ValueError(patch_type)
409
345
        if patch_type != 'bundle' and source_branch is None:
435
371
        :return: a MergeRequest
436
372
        """
437
373
        line_iter = iter(lines)
438
 
        firstline = b""
439
374
        for line in line_iter:
440
 
            if line.startswith(b'# Bazaar merge directive format '):
441
 
                return _format_registry.get(line[2:].rstrip())._from_lines(
442
 
                    line_iter)
443
 
            firstline = firstline or line.strip()
444
 
        raise errors.NotAMergeDirective(firstline)
 
375
            if line.startswith('# Bazaar merge directive format '):
 
376
                break
 
377
        else:
 
378
            if len(lines) > 0:
 
379
                raise errors.NotAMergeDirective(lines[0])
 
380
            else:
 
381
                raise errors.NotAMergeDirective('')
 
382
        return _format_registry.get(line[2:].rstrip())._from_lines(line_iter)
445
383
 
446
384
    @classmethod
447
385
    def _from_lines(klass, line_iter):
451
389
            patch = None
452
390
            patch_type = None
453
391
        else:
454
 
            patch = b''.join(patch_lines)
 
392
            patch = ''.join(patch_lines)
455
393
            try:
456
 
                bundle_serializer.read_bundle(BytesIO(patch))
 
394
                bundle_serializer.read_bundle(StringIO(patch))
457
395
            except (errors.NotABundle, errors.BundleNotSupported,
458
396
                    errors.BadBundle):
459
397
                patch_type = 'diff'
468
406
            except KeyError:
469
407
                pass
470
408
        kwargs['revision_id'] = kwargs['revision_id'].encode('utf-8')
471
 
        if 'testament_sha1' in kwargs:
472
 
            kwargs['testament_sha1'] = kwargs['testament_sha1'].encode('ascii')
473
409
        return MergeDirective(time=time, timezone=timezone,
474
410
                              patch_type=patch_type, patch=patch, **kwargs)
475
411
 
481
417
 
482
418
    @staticmethod
483
419
    def _generate_bundle(repository, revision_id, ancestor_id):
484
 
        s = BytesIO()
 
420
        s = StringIO()
485
421
        bundle_serializer.write_bundle(repository, revision_id,
486
422
                                       ancestor_id, s, '0.9')
487
423
        return s.getvalue()
494
430
        return None, self.revision_id, 'inapplicable'
495
431
 
496
432
 
497
 
class MergeDirective2(BaseMergeDirective):
 
433
class MergeDirective2(_BaseMergeDirective):
498
434
 
499
 
    _format_string = b'Bazaar merge directive format 2 (Bazaar 0.90)'
 
435
    _format_string = 'Bazaar merge directive format 2 (Bazaar 0.90)'
500
436
 
501
437
    def __init__(self, revision_id, testament_sha1, time, timezone,
502
438
                 target_branch, patch=None, source_branch=None, message=None,
503
439
                 bundle=None, base_revision_id=None):
504
440
        if source_branch is None and bundle is None:
505
441
            raise errors.NoMergeSource()
506
 
        BaseMergeDirective.__init__(self, revision_id, testament_sha1, time,
507
 
                                    timezone, target_branch, patch, source_branch, message)
 
442
        _BaseMergeDirective.__init__(self, revision_id, testament_sha1, time,
 
443
            timezone, target_branch, patch, source_branch, message)
508
444
        self.bundle = bundle
509
445
        self.base_revision_id = base_revision_id
510
446
 
526
462
        if self.bundle is None:
527
463
            return None
528
464
        else:
529
 
            return base64.b64decode(self.bundle)
 
465
            return self.bundle.decode('base-64')
530
466
 
531
467
    @classmethod
532
468
    def _from_lines(klass, line_iter):
534
470
        patch = None
535
471
        bundle = None
536
472
        try:
537
 
            start = next(line_iter)
 
473
            start = line_iter.next()
538
474
        except StopIteration:
539
475
            pass
540
476
        else:
541
 
            if start.startswith(b'# Begin patch'):
 
477
            if start.startswith('# Begin patch'):
542
478
                patch_lines = []
543
479
                for line in line_iter:
544
 
                    if line.startswith(b'# Begin bundle'):
 
480
                    if line.startswith('# Begin bundle'):
545
481
                        start = line
546
482
                        break
547
483
                    patch_lines.append(line)
548
484
                else:
549
485
                    start = None
550
 
                patch = b''.join(patch_lines)
 
486
                patch = ''.join(patch_lines)
551
487
            if start is not None:
552
 
                if start.startswith(b'# Begin bundle'):
553
 
                    bundle = b''.join(line_iter)
 
488
                if start.startswith('# Begin bundle'):
 
489
                    bundle = ''.join(line_iter)
554
490
                else:
555
 
                    raise IllegalMergeDirectivePayload(start)
 
491
                    raise errors.IllegalMergeDirectivePayload(start)
556
492
        time, timezone = timestamp.parse_patch_date(stanza.get('timestamp'))
557
493
        kwargs = {}
558
494
        for key in ('revision_id', 'testament_sha1', 'target_branch',
564
500
        kwargs['revision_id'] = kwargs['revision_id'].encode('utf-8')
565
501
        kwargs['base_revision_id'] =\
566
502
            kwargs['base_revision_id'].encode('utf-8')
567
 
        if 'testament_sha1' in kwargs:
568
 
            kwargs['testament_sha1'] = kwargs['testament_sha1'].encode('ascii')
569
503
        return klass(time=time, timezone=timezone, patch=patch, bundle=bundle,
570
504
                     **kwargs)
571
505
 
572
506
    def to_lines(self):
573
507
        lines = self._to_lines(base_revision=True)
574
508
        if self.patch is not None:
575
 
            lines.append(b'# Begin patch\n')
 
509
            lines.append('# Begin patch\n')
576
510
            lines.extend(self.patch.splitlines(True))
577
511
        if self.bundle is not None:
578
 
            lines.append(b'# Begin bundle\n')
 
512
            lines.append('# Begin bundle\n')
579
513
            lines.extend(self.bundle.splitlines(True))
580
514
        return lines
581
515
 
582
516
    @classmethod
583
517
    def from_objects(klass, repository, revision_id, time, timezone,
584
 
                     target_branch, include_patch=True, include_bundle=True,
585
 
                     local_target_branch=None, public_branch=None, message=None,
586
 
                     base_revision_id=None):
 
518
                 target_branch, include_patch=True, include_bundle=True,
 
519
                 local_target_branch=None, public_branch=None, message=None,
 
520
                 base_revision_id=None):
587
521
        """Generate a merge directive from various objects
588
522
 
589
523
        :param repository: The repository containing the revision
593
527
        :param target_branch: The url of the branch to merge into
594
528
        :param include_patch: If true, include a preview patch
595
529
        :param include_bundle: If true, include a bundle
596
 
        :param local_target_branch: the target branch, either itself or a local copy
597
 
        :param public_branch: location of a public branch containing
598
 
            the target revision.
 
530
        :param local_target_branch: a local copy of the target branch
 
531
        :param public_branch: location of a public branch containing the target
 
532
            revision.
599
533
        :param message: Message to use when committing the merge
600
534
        :return: The merge directive
601
535
 
605
539
        If the message is not supplied, the message from revision_id will be
606
540
        used for the commit.
607
541
        """
608
 
        with contextlib.ExitStack() as exit_stack:
609
 
            exit_stack.enter_context(repository.lock_write())
 
542
        locked = []
 
543
        try:
 
544
            repository.lock_write()
 
545
            locked.append(repository)
610
546
            t_revision_id = revision_id
611
 
            if revision_id == b'null:':
 
547
            if revision_id == 'null:':
612
548
                t_revision_id = None
613
549
            t = testament.StrictTestament3.from_revision(repository,
614
 
                                                         t_revision_id)
615
 
            if local_target_branch is None:
616
 
                submit_branch = _mod_branch.Branch.open(target_branch)
617
 
            else:
618
 
                submit_branch = local_target_branch
619
 
            exit_stack.enter_context(submit_branch.lock_read())
 
550
                t_revision_id)
 
551
            submit_branch = _mod_branch.Branch.open(target_branch)
 
552
            submit_branch.lock_read()
 
553
            locked.append(submit_branch)
620
554
            if submit_branch.get_public_branch() is not None:
621
555
                target_branch = submit_branch.get_public_branch()
622
556
            submit_revision_id = submit_branch.last_revision()
635
569
                patch = None
636
570
 
637
571
            if include_bundle:
638
 
                bundle = base64.b64encode(klass._generate_bundle(repository, revision_id,
639
 
                                                                 ancestor_id))
 
572
                bundle = klass._generate_bundle(repository, revision_id,
 
573
                    ancestor_id).encode('base-64')
640
574
            else:
641
575
                bundle = None
642
576
 
643
577
            if public_branch is not None and not include_bundle:
644
578
                public_branch_obj = _mod_branch.Branch.open(public_branch)
645
 
                exit_stack.enter_context(public_branch_obj.lock_read())
 
579
                public_branch_obj.lock_read()
 
580
                locked.append(public_branch_obj)
646
581
                if not public_branch_obj.repository.has_revision(
647
 
                        revision_id):
 
582
                    revision_id):
648
583
                    raise errors.PublicBranchOutOfDate(public_branch,
649
584
                                                       revision_id)
650
 
            testament_sha1 = t.as_sha1()
651
 
        return klass(revision_id, testament_sha1, time, timezone,
652
 
                     target_branch, patch, public_branch, message, bundle,
653
 
                     base_revision_id)
 
585
        finally:
 
586
            for entry in reversed(locked):
 
587
                entry.unlock()
 
588
        return klass(revision_id, t.as_sha1(), time, timezone, target_branch,
 
589
            patch, public_branch, message, bundle, base_revision_id)
654
590
 
655
591
    def _verify_patch(self, repository):
656
592
        calculated_patch = self._generate_diff(repository, self.revision_id,
657
593
                                               self.base_revision_id)
658
594
        # Convert line-endings to UNIX
659
 
        stored_patch = re.sub(b'\r\n?', b'\n', self.patch)
660
 
        calculated_patch = re.sub(b'\r\n?', b'\n', calculated_patch)
 
595
        stored_patch = re.sub('\r\n?', '\n', self.patch)
 
596
        calculated_patch = re.sub('\r\n?', '\n', calculated_patch)
661
597
        # Strip trailing whitespace
662
 
        calculated_patch = re.sub(b' *\n', b'\n', calculated_patch)
663
 
        stored_patch = re.sub(b' *\n', b'\n', stored_patch)
 
598
        calculated_patch = re.sub(' *\n', '\n', calculated_patch)
 
599
        stored_patch = re.sub(' *\n', '\n', stored_patch)
664
600
        return (calculated_patch == stored_patch)
665
601
 
666
602
    def get_merge_request(self, repository):
696
632
# already merge directives in the wild that used 0.19. Registering with the old
697
633
# format string to retain compatibility with those merge directives.
698
634
_format_registry.register(MergeDirective2,
699
 
                          b'Bazaar merge directive format 2 (Bazaar 0.19)')
 
635
                          'Bazaar merge directive format 2 (Bazaar 0.19)')