/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: John Arbash Meinel
  • Date: 2005-06-19 22:39:03 UTC
  • mto: (0.5.85) (1185.82.1 bzr-w-changeset)
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: john@arbash-meinel.com-20050619223903-b85a522a84697931
Added a bunch more information about changesets. Can now read back in all of the meta information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
    This changeset contains all of the meta-information of a
15
15
    diff, rather than just containing the patch information.
 
16
 
 
17
    Right now, rollup changesets, or working tree changesets are
 
18
    not supported. This will only generate a changeset that has been
 
19
    committed. You can use "--revision" to specify a certain change
 
20
    to display.
16
21
    """
17
22
    takes_options = ['revision', 'diff-options']
18
23
    takes_args = ['file*']
23
28
        import gen_changeset
24
29
        import sys
25
30
 
 
31
        if isinstance(revision, (list, tuple)):
 
32
            if len(revision) > 1:
 
33
                raise BzrCommandError('We do not support rollup-changesets yet.')
 
34
            revision = revision[0]
26
35
        if file_list:
27
36
            b = find_branch(file_list[0])
28
37
            file_list = [b.relpath(f) for f in file_list]
37
46
                external_diff_options=diff_options,
38
47
                to_file=sys.stdout)
39
48
 
40
 
        
41
 
 
 
49
class cmd_verify_changeset(bzrlib.commands.Command):
 
50
    """Read a written changeset, and make sure it is valid.
 
51
 
 
52
    """
 
53
    takes_args = ['filename?']
 
54
 
 
55
    def run(self, filename=None):
 
56
        import sys, read_changeset
 
57
        if filename is None or filename == '-':
 
58
            f = sys.stdin
 
59
        else:
 
60
            f = open(filename, 'rb')
 
61
 
 
62
        cset = read_changeset.read_changeset(f)
 
63
 
 
64
 
 
65
if hasattr(bzrlib.commands, 'register_plugin_cmd'):
 
66
    bzrlib.commands.register_plugin_cmd(cmd_changeset)
 
67
    bzrlib.commands.register_plugin_cmd(cmd_verify_changeset)
42
68