~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/commands.py

  • Committer: Robert Collins
  • Date: 2007-10-23 22:14:32 UTC
  • mto: (2592.6.3 repository)
  • mto: This revision was merged to the branch mainline in revision 2967.
  • Revision ID: robertc@robertcollins.net-20071023221432-j8zndh1oiegql3cu
* Commit updates the state of the working tree via a delta rather than
  supplying entirely new basis trees. For commit of a single specified file
  this reduces the wall clock time for commit by roughly a 30%.
  (Robert Collins, Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
"""\
17
17
This is an attempt to take the internal delta object, and represent
18
18
it as a single-file text-only changeset.
20
20
and for applying a changeset.
21
21
"""
22
22
 
 
23
import sys
23
24
from cStringIO import StringIO
24
25
 
25
26
from bzrlib.lazy_import import lazy_import
35
36
""")
36
37
 
37
38
from bzrlib.commands import Command
 
39
from bzrlib.option import Option
 
40
from bzrlib.trace import note
38
41
 
39
42
 
40
43
class cmd_bundle_info(Command):
41
 
    __doc__ = """Output interesting stats about a bundle"""
 
44
    """Output interesting stats about a bundle"""
42
45
 
43
46
    hidden = True
44
47
    takes_args = ['location']
51
54
        from bzrlib import osutils
52
55
        term_encoding = osutils.get_terminal_encoding()
53
56
        bundle_info = read_mergeable_from_url(location)
54
 
        if isinstance(bundle_info, merge_directive.BaseMergeDirective):
 
57
        if isinstance(bundle_info, merge_directive._BaseMergeDirective):
55
58
            bundle_file = StringIO(bundle_info.get_raw_bundle())
56
59
            bundle_info = read_bundle(bundle_file)
57
60
        else:
58
61
            if verbose:
59
 
                raise errors.BzrCommandError('--verbose requires a merge'
60
 
                    ' directive')
 
62
                raise errors.BzrCommandError('Verbose requires a merge'
 
63
                                             ' directive')
61
64
        reader_method = getattr(bundle_info, 'get_bundle_reader', None)
62
65
        if reader_method is None:
63
66
            raise errors.BzrCommandError('Bundle format not supported')