72
72
This changeset contains all of the meta-information of a
73
73
diff, rather than just containing the patch information.
75
It will store it into FILENAME if supplied, otherwise it writes
75
78
Right now, rollup changesets, or working tree changesets are
76
79
not supported. This will only generate a changeset that has been
77
80
committed. You can use "--revision" to specify a certain change
80
83
takes_options = ['revision']
84
takes_args = ['filename?']
84
def run(self, revision=None):
87
def run(self, revision=None, filename=None):
85
88
from bzrlib import find_branch
86
89
import gen_changeset
93
if filename is None or filename == '-':
94
outf = codecs.getwriter(bzrlib.user_encoding)(sys.stdout, errors='replace')
96
f = open(filename, 'wb')
97
outf = codecs.getwriter(bzrlib.user_encoding)(f, errors='replace')
89
99
if not isinstance(revision, (list, tuple)):
90
100
revision = [revision]
91
101
b = find_branch('.')
93
gen_changeset.show_changeset(b, revision,
103
gen_changeset.show_changeset(b, revision, to_file=outf)
96
105
class cmd_verify_changeset(bzrlib.commands.Command):
97
106
"""Read a written changeset, and make sure it is valid.
128
137
if filename is None or filename == '-':
131
f = open(filename, 'rb')
140
f = open(filename, 'U') # Universal newlines
133
142
apply_changeset.apply_changeset(b, f, reverse=reverse,
134
143
auto_commit=auto_commit)