~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/commands.py

  • Committer: Aaron Bentley
  • Date: 2007-02-06 14:52:16 UTC
  • mfrom: (2266 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2268.
  • Revision ID: abentley@panoramicfeedback.com-20070206145216-fcpi8o3ufvuzwbp9
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
 
1
# Copyright (C) 2006 Canonical Ltd
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
2
16
"""\
3
17
This is an attempt to take the internal delta object, and represent
4
18
it as a single-file text-only changeset.
8
22
 
9
23
import sys
10
24
 
11
 
from bzrlib.branch import Branch
12
 
from bzrlib.commands import Command, register_command
13
 
import bzrlib.errors as errors
 
25
from bzrlib.lazy_import import lazy_import
 
26
lazy_import(globals(), """
 
27
from bzrlib import (
 
28
    branch,
 
29
    errors,
 
30
    urlutils,
 
31
    )
 
32
from bzrlib.revision import common_ancestor
 
33
""")
 
34
 
 
35
from bzrlib.commands import Command
14
36
from bzrlib.option import Option
15
 
from bzrlib.revision import (common_ancestor, MultipleRevisionSources,
16
 
                             NULL_REVISION)
17
37
from bzrlib.trace import note
18
 
from bzrlib import urlutils
19
38
 
20
39
 
21
40
class cmd_send_changeset(Command):
43
62
                raise BzrCommandError('We do not support rollup-changesets yet.')
44
63
            revision = revision[0]
45
64
 
46
 
        b = Branch.open_containing('.')
 
65
        b = branch.Branch.open_containing('.')
47
66
 
48
67
        if not to:
49
68
            try:
79
98
                            type=unicode)]
80
99
    takes_args = ['base?']
81
100
    aliases = ['bundle']
 
101
    encoding_type = 'exact'
82
102
 
83
103
    def run(self, base=None, revision=None, output=None, remember=False):
84
104
        from bzrlib import user_encoding
85
105
        from bzrlib.bundle.serializer import write_bundle
86
106
 
87
 
        target_branch = Branch.open_containing(u'.')[0]
 
107
        target_branch = branch.Branch.open_containing(u'.')[0]
88
108
 
89
109
        if base is None:
90
110
            base_specified = False
118
138
                # we must format with 'ascii' to be safe
119
139
                note('Using saved location: %s',
120
140
                     urlutils.unescape_for_display(base, 'ascii'))
121
 
            base_branch = Branch.open(base)
 
141
            base_branch = branch.Branch.open(base)
122
142
 
123
143
            # We don't want to lock the same branch across
124
144
            # 2 different branches
159
179
        from read_changeset import read_changeset
160
180
        #from bzrlib.xml import serializer_v4
161
181
 
162
 
        b, relpath = Branch.open_containing('.')
 
182
        b, relpath = branch.Branch.open_containing('.')
163
183
 
164
184
        if filename is None or filename == '-':
165
185
            f = sys.stdin