~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/commands.py

  • Committer: John Arbash Meinel
  • Date: 2006-10-11 00:23:23 UTC
  • mfrom: (2070 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2071.
  • Revision ID: john@arbash-meinel.com-20061011002323-82ba88c293d7caff
[merge] bzr.dev 2070

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
import sys
10
10
 
11
 
from bzrlib.branch import Branch
12
 
from bzrlib.commands import Command, register_command
13
 
import bzrlib.errors as errors
 
11
from bzrlib.lazy_import import lazy_import
 
12
lazy_import(globals(), """
 
13
from bzrlib import (
 
14
    branch,
 
15
    errors,
 
16
    urlutils,
 
17
    )
 
18
from bzrlib.revision import common_ancestor
 
19
""")
 
20
 
 
21
from bzrlib.commands import Command
14
22
from bzrlib.option import Option
15
 
from bzrlib.revision import (common_ancestor, MultipleRevisionSources,
16
 
                             NULL_REVISION)
17
 
from bzrlib.revisionspec import RevisionSpec
18
23
from bzrlib.trace import note
19
 
from bzrlib import urlutils
20
24
 
21
25
 
22
26
class cmd_send_changeset(Command):
44
48
                raise BzrCommandError('We do not support rollup-changesets yet.')
45
49
            revision = revision[0]
46
50
 
47
 
        b = Branch.open_containing('.')
 
51
        b = branch.Branch.open_containing('.')
48
52
 
49
53
        if not to:
50
54
            try:
85
89
        from bzrlib import user_encoding
86
90
        from bzrlib.bundle.serializer import write_bundle
87
91
 
88
 
        target_branch = Branch.open_containing(u'.')[0]
 
92
        target_branch = branch.Branch.open_containing(u'.')[0]
89
93
 
90
94
        if base is None:
91
95
            base_specified = False
119
123
                # we must format with 'ascii' to be safe
120
124
                note('Using saved location: %s',
121
125
                     urlutils.unescape_for_display(base, 'ascii'))
122
 
            base_branch = Branch.open(base)
 
126
            base_branch = branch.Branch.open(base)
123
127
 
124
128
            # We don't want to lock the same branch across
125
129
            # 2 different branches
142
146
            fileobj = file(output, 'wb')
143
147
        else:
144
148
            fileobj = sys.stdout
145
 
        write_bundle(target_branch.repository, target_revision, base_revision,
146
 
                     fileobj)
 
149
        target_branch.repository.lock_read()
 
150
        try:
 
151
            write_bundle(target_branch.repository, target_revision,
 
152
                         base_revision, fileobj)
 
153
        finally:
 
154
            target_branch.repository.unlock()
147
155
 
148
156
 
149
157
class cmd_verify_changeset(Command):
156
164
        from read_changeset import read_changeset
157
165
        #from bzrlib.xml import serializer_v4
158
166
 
159
 
        b, relpath = Branch.open_containing('.')
 
167
        b, relpath = branch.Branch.open_containing('.')
160
168
 
161
169
        if filename is None or filename == '-':
162
170
            f = sys.stdin