959
959
except errors.NoWorkingTree:
960
960
source.bzrdir.create_workingtree(revision_id)
963
os.mkdir(to_location)
965
if e.errno == errno.EEXIST:
966
raise errors.BzrCommandError('Target directory "%s" already'
967
' exists.' % to_location)
968
if e.errno == errno.ENOENT:
969
raise errors.BzrCommandError('Parent of "%s" does not exist.'
973
962
source.create_checkout(to_location, revision_id, lightweight)
2146
2135
committed. If a directory is specified then the directory and everything
2147
2136
within it is committed.
2138
If author of the change is not the same person as the committer, you can
2139
specify the author's name using the --author option. The name should be
2140
in the same format as a committer-id, e.g. "John Doe <jdoe@example.com>".
2149
2142
A selected-file commit may fail in some cases where the committed
2150
2143
tree would be invalid. Consider::
2192
2185
"files in the working tree."),
2193
2186
ListOption('fixes', type=str,
2194
2187
help="Mark a bug as being fixed by this revision."),
2188
Option('author', type=str,
2189
help="Set the author's name, if it's different "
2190
"from the committer."),
2195
2191
Option('local',
2196
2192
help="Perform a local commit in a bound "
2197
2193
"branch. Local commits are not pushed to "
2224
2220
return '\n'.join(properties)
2226
2222
def run(self, message=None, file=None, verbose=True, selected_list=None,
2227
unchanged=False, strict=False, local=False, fixes=None):
2223
unchanged=False, strict=False, local=False, fixes=None,
2228
2225
from bzrlib.commit import (NullCommitReporter, ReportCommitToLog)
2229
2226
from bzrlib.errors import (PointlessCommit, ConflictsInTree,
2230
2227
StrictCommitFailed)
2281
2278
tree.commit(message_callback=get_message,
2282
2279
specific_files=selected_list,
2283
2280
allow_pointless=unchanged, strict=strict, local=local,
2284
reporter=reporter, revprops=properties)
2281
reporter=reporter, revprops=properties,
2285
2283
except PointlessCommit:
2286
2284
# FIXME: This should really happen before the file is read in;
2287
2285
# perhaps prepare the commit; get the message; then actually commit
3238
3236
import bzrlib.plugin
3239
3237
from inspect import getdoc
3240
for name, plugin in bzrlib.plugin.all_plugins().items():
3241
if getattr(plugin, '__path__', None) is not None:
3242
print plugin.__path__[0]
3243
elif getattr(plugin, '__file__', None) is not None:
3244
print plugin.__file__
3238
for name, plugin in bzrlib.plugin.plugins().items():
3239
print plugin.path(), "[%s]" % plugin.__version__
3240
d = getdoc(plugin.module)
3250
3242
print '\t', d.split('\n')[0]
3421
3413
--verbose will print out what is being removed.
3422
3414
--dry-run will go through all the motions, but not actually
3423
3415
remove anything.
3417
If --revision is specified, uncommit revisions to leave the branch at the
3418
specified revision. For example, "bzr uncommit -r 15" will leave the
3419
branch at revision 15.
3425
3421
In the future, uncommit will create a revision bundle, which can then
3808
3804
can be used as your actual submit branch, once you have set public_branch
3809
3805
for that mirror.
3807
Mail is sent using your preferred mail program. This should be transparent
3808
on Windows (it uses MAPI). On *nix, it requires the xdg-email utility. If
3809
the preferred client can't be found (or used), your editor will be used.
3811
To use a specific mail program, set the mail_client configuration option.
3812
(For Thunderbird 1.5, this works around some bugs.) Supported values are
3813
"thunderbird", "evolution", "editor", "xdg-email", "mapi", "kmail" and
3816
If mail is being sent, a to address is required. This can be supplied
3817
either on the commandline, or by setting the submit_to configuration
3811
3820
Two formats are currently supported: "4" uses revision bundle format 4 and
3812
3821
merge directive format 2. It is significantly faster and smaller than
3813
3822
older formats. It is compatible with Bazaar 0.19 and later. It is the
3836
3845
Option('output', short_name='o', help='Write directive to this file.',
3847
Option('mail-to', help='Mail the request to this address.',
3839
3851
RegistryOption.from_kwargs('format',
3840
3852
'Use the specified output format.',
3841
3853
**{'4': 'Bundle format 4, Merge Directive 2 (default)',
3845
3857
def run(self, submit_branch=None, public_branch=None, no_bundle=False,
3846
3858
no_patch=False, revision=None, remember=False, output=None,
3847
format='4', **kwargs):
3849
raise errors.BzrCommandError('File must be specified with'
3859
format='4', mail_to=None, message=None, **kwargs):
3851
3860
return self._run(submit_branch, revision, public_branch, remember,
3852
3861
format, no_bundle, no_patch, output,
3853
kwargs.get('from', '.'))
3862
kwargs.get('from', '.'), mail_to, message)
3855
3864
def _run(self, submit_branch, revision, public_branch, remember, format,
3856
no_bundle, no_patch, output, from_,):
3865
no_bundle, no_patch, output, from_, mail_to, message):
3857
3866
from bzrlib.revision import ensure_null, NULL_REVISION
3868
outfile = StringIO()
3859
3870
outfile = self.outf
3861
3872
outfile = open(output, 'wb')
3863
3874
branch = Branch.open_containing(from_)[0]
3876
config = branch.get_config()
3878
mail_to = config.get_user_option('submit_to')
3880
raise errors.BzrCommandError('No mail-to address'
3882
mail_client = config.get_mail_client()
3864
3883
if remember and submit_branch is None:
3865
3884
raise errors.BzrCommandError(
3866
3885
'--remember requires a branch to be specified.')
3908
3927
branch.repository, revision_id, time.time(),
3909
3928
osutils.local_time_offset(), submit_branch,
3910
3929
public_branch=public_branch, include_patch=not no_patch,
3911
include_bundle=not no_bundle, message=None,
3930
include_bundle=not no_bundle, message=message,
3912
3931
base_revision_id=base_revision_id)
3913
3932
elif format == '0.9':
3914
3933
if not no_bundle:
3926
3945
branch.repository, revision_id, time.time(),
3927
3946
osutils.local_time_offset(), submit_branch,
3928
3947
public_branch=public_branch, patch_type=patch_type,
3931
3950
outfile.writelines(directive.to_lines())
3952
subject = '[MERGE] '
3953
if message is not None:
3956
revision = branch.repository.get_revision(revision_id)
3957
subject += revision.get_summary()
3958
mail_client.compose_merge_request(mail_to, subject,
3933
3961
if output != '-':
3934
3962
outfile.close()
3968
3996
format 1. It is compatible with Bazaar 0.12 - 0.18.
4001
help='Do not include a bundle in the merge directive.'),
4002
Option('no-patch', help='Do not include a preview patch in the merge'
4005
help='Remember submit and public branch.'),
4007
help='Branch to generate the submission from, '
4008
'rather than the one containing the working directory.',
4011
Option('output', short_name='o', help='Write directive to this file.',
4014
RegistryOption.from_kwargs('format',
4015
'Use the specified output format.',
4016
**{'4': 'Bundle format 4, Merge Directive 2 (default)',
4017
'0.9': 'Bundle format 0.9, Merge Directive 1',})
3971
4019
aliases = ['bundle']
3973
4021
_see_also = ['send', 'merge']
3982
4030
return self._run(submit_branch, revision, public_branch, remember,
3983
4031
format, no_bundle, no_patch, output,
3984
kwargs.get('from', '.'))
4032
kwargs.get('from', '.'), None, None)
3987
4035
class cmd_tag(Command):