~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-05-21 14:06:43 UTC
  • mfrom: (4370.2.1 submit-format)
  • Revision ID: pqm@pqm.ubuntu.com-20090521140643-e0igtobdd3k832wb
(Jelmer) Add child_submit_format option used by 'bzr send'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4891
4891
 
4892
4892
    def run(self, submit_branch=None, public_branch=None, no_bundle=False,
4893
4893
            no_patch=False, revision=None, remember=False, output=None,
4894
 
            format='4', mail_to=None, message=None, body=None, **kwargs):
 
4894
            format=None, mail_to=None, message=None, body=None, **kwargs):
4895
4895
        return self._run(submit_branch, revision, public_branch, remember,
4896
4896
                         format, no_bundle, no_patch, output,
4897
4897
                         kwargs.get('from', '.'), mail_to, message, body)
4936
4936
                        'changes to submit.', remembered_submit_branch,
4937
4937
                        submit_branch)
4938
4938
 
4939
 
            if mail_to is None:
 
4939
            if mail_to is None or format is None:
4940
4940
                submit_config = Branch.open(submit_branch).get_config()
4941
 
                mail_to = submit_config.get_user_option("child_submit_to")
 
4941
                if mail_to is None:
 
4942
                    mail_to = submit_config.get_user_option("child_submit_to")
 
4943
                if format is None:
 
4944
                    format = submit_config.get_user_option("child_submit_format")
4942
4945
 
4943
4946
            stored_public_branch = branch.get_public_branch()
4944
4947
            if public_branch is None:
4961
4964
                revision_id = branch.last_revision()
4962
4965
            if revision_id == NULL_REVISION:
4963
4966
                raise errors.BzrCommandError('No revisions to submit.')
 
4967
            if format is None:
 
4968
                format = '4'
4964
4969
            if format == '4':
4965
4970
                directive = merge_directive.MergeDirective2.from_objects(
4966
4971
                    branch.repository, revision_id, time.time(),
4985
4990
                    osutils.local_time_offset(), submit_branch,
4986
4991
                    public_branch=public_branch, patch_type=patch_type,
4987
4992
                    message=message)
 
4993
            else:
 
4994
                raise errors.BzrCommandError("No such send format '%s'." % 
 
4995
                                             format)
4988
4996
 
4989
4997
            if output is None:
4990
4998
                directive.compose_merge_request(mail_client, mail_to, body,
5065
5073
 
5066
5074
    def run(self, submit_branch=None, public_branch=None, no_bundle=False,
5067
5075
            no_patch=False, revision=None, remember=False, output=None,
5068
 
            format='4', **kwargs):
 
5076
            format=None, **kwargs):
5069
5077
        if output is None:
5070
5078
            output = '-'
5071
5079
        return self._run(submit_branch, revision, public_branch, remember,