1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/usr/bin/env python
"""\
This is an attempt to take the internal delta object, and represent
it as a single-file text-only changeset.
This should have commands for both generating a changeset,
and for applying a changeset.
"""
import bzrlib, bzrlib.commands
class cmd_changeset(bzrlib.commands.Command):
"""Generate a bundled up changeset.
This changeset contains all of the meta-information of a
diff, rather than just containing the patch information.
"""
takes_options = ['revision', 'diff-options']
takes_args = ['file*']
aliases = ['cset']
def run(self, revision=None, file_list=None, diff_options=None):
from bzrlib import find_branch
import gen_changeset
import sys
if file_list:
b = find_branch(file_list[0])
file_list = [b.relpath(f) for f in file_list]
if file_list == ['']:
# just pointing to top-of-tree
file_list = None
else:
b = find_branch('.')
gen_changeset.show_changeset(b, revision,
specific_files=file_list,
external_diff_options=diff_options,
to_file=sys.stdout)
|