/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 bzrlib/bundle/commands.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-20 14:51:03 UTC
  • mfrom: (0.8.23 version_info)
  • mto: This revision was merged to the branch mainline in revision 2028.
  • Revision ID: john@arbash-meinel.com-20060920145103-02725c6d6c886040
[merge] version-info plugin, and cleanup for layout in bzr

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)
37
17
from bzrlib.trace import note
 
18
from bzrlib import urlutils
38
19
 
39
20
 
40
21
class cmd_send_changeset(Command):
62
43
                raise BzrCommandError('We do not support rollup-changesets yet.')
63
44
            revision = revision[0]
64
45
 
65
 
        b = branch.Branch.open_containing('.')
 
46
        b = Branch.open_containing('.')
66
47
 
67
48
        if not to:
68
49
            try:
86
67
 
87
68
    bzr bundle-revisions
88
69
        - Generate a bundle relative to a remembered location
89
 
 
90
70
    bzr bundle-revisions BASE
91
71
        - Bundle to apply the current tree into BASE
92
 
 
93
72
    bzr bundle-revisions --revision A
94
73
        - Bundle to apply revision A to remembered location 
95
 
 
96
74
    bzr bundle-revisions --revision A..B
97
75
        - Bundle to transform A into B
98
76
    """
99
 
    takes_options = ['revision', 'remember',
 
77
    takes_options = ['verbose', 'revision', 'remember',
100
78
                     Option("output", help="write bundle to specified file",
101
79
                            type=unicode)]
102
80
    takes_args = ['base?']
103
81
    aliases = ['bundle']
104
 
    encoding_type = 'exact'
105
82
 
106
83
    def run(self, base=None, revision=None, output=None, remember=False):
107
84
        from bzrlib import user_encoding
108
85
        from bzrlib.bundle.serializer import write_bundle
109
86
 
110
 
        target_branch = branch.Branch.open_containing(u'.')[0]
 
87
        target_branch = Branch.open_containing(u'.')[0]
111
88
 
112
89
        if base is None:
113
90
            base_specified = False
141
118
                # we must format with 'ascii' to be safe
142
119
                note('Using saved location: %s',
143
120
                     urlutils.unescape_for_display(base, 'ascii'))
144
 
            base_branch = branch.Branch.open(base)
 
121
            base_branch = Branch.open(base)
145
122
 
146
123
            # We don't want to lock the same branch across
147
124
            # 2 different branches
182
159
        from read_changeset import read_changeset
183
160
        #from bzrlib.xml import serializer_v4
184
161
 
185
 
        b, relpath = branch.Branch.open_containing('.')
 
162
        b, relpath = Branch.open_containing('.')
186
163
 
187
164
        if filename is None or filename == '-':
188
165
            f = sys.stdin