~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/commands.py

  • Committer: Alexander Belchenko
  • Date: 2006-06-06 19:28:58 UTC
  • mto: (1185.84.2 bundles)
  • mto: This revision was merged to the branch mainline in revision 1749.
  • Revision ID: bialix@ukr.net-20060606192858-9f0721421ae29ce0
Added --output option for bundle-revisions command

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        - Bundle to transform revision A of BASE into revision B
77
77
          of the local tree
78
78
    """
79
 
    takes_options = ['verbose', 'revision']
 
79
    takes_options = ['verbose', 'revision',
 
80
                     Option("output", help="write bundle to specified file",
 
81
                            type=unicode)]
80
82
    takes_args = ['base?']
81
83
    aliases = ['bundle']
82
84
 
83
 
    def run(self, base=None, revision=None):
 
85
    def run(self, base=None, revision=None, output=None):
84
86
        from bzrlib import user_encoding
85
87
        from bzrlib.bundle.serializer import write_bundle
86
88
 
132
134
            target_branch.repository.fetch(base_branch.repository, 
133
135
                                           revision_id=base_revision)
134
136
            del base_branch
 
137
 
 
138
        if output is not None:
 
139
            fileobj = file(output, 'wb')
 
140
        else:
 
141
            fileobj = sys.stdout
135
142
        write_bundle(target_branch.repository, target_revision, base_revision,
136
 
                     sys.stdout)
 
143
                     fileobj)
137
144
 
138
145
 
139
146
class cmd_verify_changeset(Command):