/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-17 16:36:15 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: jameinel@Jigglypuff.local-20050617163615-7797b80441754f0e
Just an initial working step.

Show diffs side-by-side

added added

removed removed

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