~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-08-14 16:16:53 UTC
  • mto: (1946.2.6 reduce-knit-churn)
  • mto: This revision was merged to the branch mainline in revision 1919.
  • Revision ID: john@arbash-meinel.com-20060814161653-54cdcdadcd4e9003
Remove bogus entry from BRANCH.TODO

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
1
#!/usr/bin/env python
16
2
"""\
17
3
This is an attempt to take the internal delta object, and represent
18
4
it as a single-file text-only changeset.
22
8
 
23
9
import sys
24
10
 
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
 
11
from bzrlib.branch import Branch
 
12
from bzrlib.commands import Command, register_command
 
13
import bzrlib.errors as errors
36
14
from bzrlib.option import Option
 
15
from bzrlib.revision import (common_ancestor, MultipleRevisionSources,
 
16
                             NULL_REVISION)
 
17
from bzrlib.revisionspec import RevisionSpec
37
18
from bzrlib.trace import note
 
19
from bzrlib import urlutils
38
20
 
39
21
 
40
22
class cmd_send_changeset(Command):
62
44
                raise BzrCommandError('We do not support rollup-changesets yet.')
63
45
            revision = revision[0]
64
46
 
65
 
        b = branch.Branch.open_containing('.')
 
47
        b = Branch.open_containing('.')
66
48
 
67
49
        if not to:
68
50
            try:
103
85
        from bzrlib import user_encoding
104
86
        from bzrlib.bundle.serializer import write_bundle
105
87
 
106
 
        target_branch = branch.Branch.open_containing(u'.')[0]
 
88
        target_branch = Branch.open_containing(u'.')[0]
107
89
 
108
90
        if base is None:
109
91
            base_specified = False
137
119
                # we must format with 'ascii' to be safe
138
120
                note('Using saved location: %s',
139
121
                     urlutils.unescape_for_display(base, 'ascii'))
140
 
            base_branch = branch.Branch.open(base)
 
122
            base_branch = Branch.open(base)
141
123
 
142
124
            # We don't want to lock the same branch across
143
125
            # 2 different branches
160
142
            fileobj = file(output, 'wb')
161
143
        else:
162
144
            fileobj = sys.stdout
163
 
        target_branch.repository.lock_read()
164
 
        try:
165
 
            write_bundle(target_branch.repository, target_revision,
166
 
                         base_revision, fileobj)
167
 
        finally:
168
 
            target_branch.repository.unlock()
 
145
        write_bundle(target_branch.repository, target_revision, base_revision,
 
146
                     fileobj)
169
147
 
170
148
 
171
149
class cmd_verify_changeset(Command):
178
156
        from read_changeset import read_changeset
179
157
        #from bzrlib.xml import serializer_v4
180
158
 
181
 
        b, relpath = branch.Branch.open_containing('.')
 
159
        b, relpath = Branch.open_containing('.')
182
160
 
183
161
        if filename is None or filename == '-':
184
162
            f = sys.stdin