15
15
from bzrlib.revision import (common_ancestor, MultipleRevisionSources,
17
17
from bzrlib.revisionspec import RevisionSpec
18
from bzrlib.trace import note
20
21
class cmd_send_changeset(Command):
65
66
You can apply it to another tree using 'bzr merge'.
68
69
- Bundle for the last commit
70
bzr bundle-revisions BASE
70
71
- Bundle to apply the current tree into BASE
71
bzr bundle --revision A
72
bzr bundle-revisions --revision A
72
73
- Bundle for revision A
73
bzr bundle --revision A..B
74
bzr bundle-revisions --revision A..B
74
75
- Bundle to transform A into B
75
bzr bundle --revision A..B BASE
76
bzr bundle-revisions --revision A..B BASE
76
77
- Bundle to transform revision A of BASE into revision B
79
takes_options = ['verbose', 'revision']
80
takes_options = ['verbose', 'revision',
81
Option("output", help="write bundle to specified file",
80
83
takes_args = ['base?']
81
84
aliases = ['bundle']
83
def run(self, base=None, revision=None):
86
def run(self, base=None, revision=None, output=None):
84
87
from bzrlib import user_encoding
85
88
from bzrlib.bundle.serializer import write_bundle
90
target_branch = Branch.open_containing(u'.')[0]
90
base_branch = Branch.open(base)
93
base = target_branch.get_parent()
95
raise errors.BzrCommandError("No base branch known or"
98
note('Using saved location: %s' % base)
99
base_branch = Branch.open(base)
92
101
# We don't want to lock the same branch across
93
102
# 2 different branches
94
target_branch = Branch.open_containing(u'.')[0]
95
if base_branch is not None and target_branch.base == base_branch.base:
103
if target_branch.base == base_branch.base:
104
base_branch = target_branch
98
106
base_revision = None
99
107
if revision is None:
132
140
target_branch.repository.fetch(base_branch.repository,
133
141
revision_id=base_revision)
144
if output is not None:
145
fileobj = file(output, 'wb')
135
148
write_bundle(target_branch.repository, target_revision, base_revision,
139
152
class cmd_verify_changeset(Command):