1084
1085
takes_options = ['verbose',
1085
1086
Option('new', help='Remove newly-added files.'),
1086
1087
RegistryOption.from_kwargs('file-deletion-strategy',
1087
'The file deletion mode to be used',
1088
'The file deletion mode to be used.',
1088
1089
title='Deletion Strategy', value_switches=True, enum_switch=False,
1089
1090
safe='Only delete files if they can be'
1090
1091
' safely recovered (default).',
1328
1330
If the --no-trees option is used then the branches in the repository
1329
1331
will not have working trees by default.
1332
bzr init-repo --no-trees repo
1334
bzr checkout --lightweight repo/trunk trunk-checkout
1338
See 'bzr help repositories' for more information.
1334
Create a shared repositories holding just branches::
1336
bzr init-repo --no-trees repo
1339
Make a lightweight checkout elsewhere::
1341
bzr checkout --lightweight repo/trunk trunk-checkout
1341
_see_also = ['init', 'branch', 'checkout']
1346
_see_also = ['init', 'branch', 'checkout', 'repositories']
1342
1347
takes_args = ["location"]
1343
1348
takes_options = [RegistryOption('format',
1344
1349
help='Specify a format for this repository. See'
1376
1381
"bzr diff -p1" is equivalent to "bzr diff --prefix old/:new/", and
1377
1382
produces patches suitable for "patch -p1".
1381
Shows the difference in the working tree versus the last commit
1383
Difference between the working tree and revision 1
1385
Difference between revision 2 and revision 1
1386
bzr diff --prefix old/:new/
1387
Same as 'bzr diff' but prefix paths with old/ and new/
1388
bzr diff bzr.mine bzr.dev
1389
Show the differences between the two working trees
1391
Show just the differences for 'foo.c'
1385
Shows the difference in the working tree versus the last commit::
1389
Difference between the working tree and revision 1::
1393
Difference between revision 2 and revision 1::
1397
Same as 'bzr diff' but prefix paths with old/ and new/::
1399
bzr diff --prefix old/:new/
1401
Show the differences between the two working trees::
1403
bzr diff bzr.mine bzr.dev
1405
Show just the differences for 'foo.c'::
1393
1409
# TODO: Option to use external diff command; could be GNU diff, wdiff,
1394
1410
# or a graphical diff.
2591
2640
The results of the merge are placed into the destination working
2592
2641
directory, where they can be reviewed (with bzr diff), tested, and then
2593
2642
committed to record the result of the merge.
2597
To merge the latest revision from bzr.dev:
2598
bzr merge ../bzr.dev
2600
To merge changes up to and including revision 82 from bzr.dev:
2601
bzr merge -r 82 ../bzr.dev
2603
To merge the changes introduced by 82, without previous changes:
2604
bzr merge -r 81..82 ../bzr.dev
2606
2644
merge refuses to run if there are any uncommitted changes, unless
2607
2645
--force is given.
2648
To merge the latest revision from bzr.dev::
2650
bzr merge ../bzr.dev
2652
To merge changes up to and including revision 82 from bzr.dev::
2654
bzr merge -r 82 ../bzr.dev
2656
To merge the changes introduced by 82, without previous changes::
2658
bzr merge -r 81..82 ../bzr.dev
2610
2661
_see_also = ['update', 'remerge', 'status-flags']
2837
2889
merge. The difference is that remerge can (only) be run when there is a
2838
2890
pending merge, and it lets you specify particular files.
2842
$ bzr remerge --show-base
2843
2893
Re-do the merge of all conflicted files, and show the base text in
2844
conflict regions, in addition to the usual THIS and OTHER texts.
2894
conflict regions, in addition to the usual THIS and OTHER texts::
2896
bzr remerge --show-base
2846
$ bzr remerge --merge-type weave --reprocess foobar
2847
2898
Re-do the merge of "foobar", using the weave merge algorithm, with
2848
additional processing to reduce the size of conflict regions.
2899
additional processing to reduce the size of conflict regions::
2901
bzr remerge --merge-type weave --reprocess foobar
2850
2903
takes_args = ['file*']
2851
2904
takes_options = [
3770
3830
Option('output', short_name='o', help='Write directive to this file.',
3833
RegistryOption.from_kwargs('format',
3834
'Use the specified output format.',
3835
**{'4': 'Bundle format 4, Merge Directive 2 (default)',
3836
'0.9': 'Bundle format 0.9, Merge Directive 1',})
3775
3839
def run(self, submit_branch=None, public_branch=None, no_bundle=False,
3776
3840
no_patch=False, revision=None, remember=False, output=None,
3778
from bzrlib.revision import ensure_null, NULL_REVISION
3841
format='4', **kwargs):
3779
3842
if output is None:
3780
3843
raise errors.BzrCommandError('File must be specified with'
3845
return self._run(submit_branch, revision, public_branch, remember,
3846
format, no_bundle, no_patch, output,
3847
kwargs.get('from', '.'))
3849
def _run(self, submit_branch, revision, public_branch, remember, format,
3850
no_bundle, no_patch, output, from_,):
3851
from bzrlib.revision import ensure_null, NULL_REVISION
3783
3853
outfile = self.outf
3785
3855
outfile = open(output, 'wb')
3787
from_ = kwargs.get('from', '.')
3788
3857
branch = Branch.open_containing(from_)[0]
3789
3858
if remember and submit_branch is None:
3790
3859
raise errors.BzrCommandError(
3828
3897
revision_id = ensure_null(revision_id)
3829
3898
if revision_id == NULL_REVISION:
3830
3899
raise errors.BzrCommandError('No revisions to submit.')
3831
directive = merge_directive.MergeDirective2.from_objects(
3832
branch.repository, revision_id, time.time(),
3833
osutils.local_time_offset(), submit_branch,
3834
public_branch=public_branch, include_patch=not no_patch,
3835
include_bundle=not no_bundle, message=None,
3836
base_revision_id=base_revision_id)
3901
directive = merge_directive.MergeDirective2.from_objects(
3902
branch.repository, revision_id, time.time(),
3903
osutils.local_time_offset(), submit_branch,
3904
public_branch=public_branch, include_patch=not no_patch,
3905
include_bundle=not no_bundle, message=None,
3906
base_revision_id=base_revision_id)
3907
elif format == '0.9':
3910
patch_type = 'bundle'
3912
raise errors.BzrCommandError('Format 0.9 does not'
3913
' permit bundle with no patch')
3919
directive = merge_directive.MergeDirective.from_objects(
3920
branch.repository, revision_id, time.time(),
3921
osutils.local_time_offset(), submit_branch,
3922
public_branch=public_branch, patch_type=patch_type,
3837
3925
outfile.writelines(directive.to_lines())
3839
3927
if output != '-':
3840
3928
outfile.close()
3931
class cmd_bundle_revisions(cmd_send):
3933
"""Create a merge-directive for submiting changes.
3935
A merge directive provides many things needed for requesting merges:
3937
* A machine-readable description of the merge to perform
3939
* An optional patch that is a preview of the changes requested
3941
* An optional bundle of revision data, so that the changes can be applied
3942
directly from the merge directive, without retrieving data from a
3945
If --no-bundle is specified, then public_branch is needed (and must be
3946
up-to-date), so that the receiver can perform the merge using the
3947
public_branch. The public_branch is always included if known, so that
3948
people can check it later.
3950
The submit branch defaults to the parent, but can be overridden. Both
3951
submit branch and public branch will be remembered if supplied.
3953
If a public_branch is known for the submit_branch, that public submit
3954
branch is used in the merge instructions. This means that a local mirror
3955
can be used as your actual submit branch, once you have set public_branch
3958
Two formats are currently supported: "4" uses revision bundle format 4 and
3959
merge directive format 2. It is significantly faster and smaller than
3960
older formats. It is compatible with Bazaar 0.19 and later. It is the
3961
default. "0.9" uses revision bundle format 0.9 and merge directive
3962
format 1. It is compatible with Bazaar 0.12 - 0.18.
3965
aliases = ['bundle']
3967
_see_also = ['send', 'merge']
3971
def run(self, submit_branch=None, public_branch=None, no_bundle=False,
3972
no_patch=False, revision=None, remember=False, output=None,
3973
format='4', **kwargs):
3976
return self._run(submit_branch, revision, public_branch, remember,
3977
format, no_bundle, no_patch, output,
3978
kwargs.get('from', '.'))
3843
3981
class cmd_tag(Command):
3844
3982
"""Create, remove or modify a tag naming a revision.