~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Vincent Ladeuil
  • Date: 2009-06-26 18:13:41 UTC
  • mto: (4498.2.2 integration)
  • mto: This revision was merged to the branch mainline in revision 4501.
  • Revision ID: v.ladeuil+lp@free.fr-20090626181341-grhq7i0h0gv7xlcb
Fix bug #206577 by adding a --strict option to send.

* bzrlib/tests/blackbox/test_send.py:
(load_tests): Test send --strict for uncommitted changes and
pending merges.
(TestSendBase): Factor out some common helpers.
(TestSendStrict): Helpers for --strict option tests.
(TestSendStrictWithoutChanges, TestSendStrictWithChanges): Test
the --strict option.

* bzrlib/send.py:
(send): Handle the strict option.

* bzrlib/help_topics/en/configuration.txt:
(send_strict): Document.

* bzrlib/builtins.py:
(cmd_send): Add a '--strict' option.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4886
4886
               help='Write merge directive to this file; '
4887
4887
                    'use - for stdout.',
4888
4888
               type=unicode),
 
4889
        Option('strict',
 
4890
               help='Refuse to send if there are uncommitted changes in'
 
4891
               ' the working tree.'),
4889
4892
        Option('mail-to', help='Mail the request to this address.',
4890
4893
               type=unicode),
4891
4894
        'revision',
4892
4895
        'message',
4893
4896
        Option('body', help='Body for the email.', type=unicode),
4894
4897
        RegistryOption('format',
4895
 
                       help='Use the specified output format.', 
4896
 
                       lazy_registry=('bzrlib.send', 'format_registry'))
 
4898
                       help='Use the specified output format.',
 
4899
                       lazy_registry=('bzrlib.send', 'format_registry')),
4897
4900
        ]
4898
4901
 
4899
4902
    def run(self, submit_branch=None, public_branch=None, no_bundle=False,
4900
4903
            no_patch=False, revision=None, remember=False, output=None,
4901
 
            format=None, mail_to=None, message=None, body=None, **kwargs):
 
4904
            format=None, mail_to=None, message=None, body=None,
 
4905
            strict=None, **kwargs):
4902
4906
        from bzrlib.send import send
4903
4907
        return send(submit_branch, revision, public_branch, remember,
4904
 
                         format, no_bundle, no_patch, output,
4905
 
                         kwargs.get('from', '.'), mail_to, message, body,
4906
 
                         self.outf)
 
4908
                    format, no_bundle, no_patch, output,
 
4909
                    kwargs.get('from', '.'), mail_to, message, body,
 
4910
                    self.outf,
 
4911
                    strict=strict)
4907
4912
 
4908
4913
 
4909
4914
class cmd_bundle_revisions(cmd_send):