/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/bundle_data.py

  • Committer: Martin Pool
  • Date: 2007-09-14 06:31:28 UTC
  • mfrom: (2822 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2823.
  • Revision ID: mbp@sourcefrog.net-20070914063128-0p7mh6zfb4pzdg9p
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from bzrlib import (
25
25
    osutils,
 
26
    timestamp,
26
27
    )
27
28
import bzrlib.errors
28
29
from bzrlib.bundle import apply_bundle
87
88
 
88
89
        return rev
89
90
 
 
91
    @staticmethod
 
92
    def from_revision(revision):
 
93
        revision_info = RevisionInfo(revision.revision_id)
 
94
        date = timestamp.format_highres_date(revision.timestamp,
 
95
                                             revision.timezone)
 
96
        revision_info.date = date
 
97
        revision_info.timezone = revision.timezone
 
98
        revision_info.timestamp = revision.timestamp
 
99
        revision_info.message = revision.message.split('\n')
 
100
        revision_info.properties = [': '.join(p) for p in
 
101
                                    revision.properties.iteritems()]
 
102
        return revision_info
 
103
 
90
104
 
91
105
class BundleInfo(object):
92
106
    """This contains the meta information. Stuff that allows you to
93
107
    recreate the revision or inventory XML.
94
108
    """
95
 
    def __init__(self):
 
109
    def __init__(self, bundle_format=None):
 
110
        self.bundle_format = None
96
111
        self.committer = None
97
112
        self.date = None
98
113
        self.message = None
442
457
                        ' (unrecognized action): %r' % action_line)
443
458
            valid_actions[action](kind, extra, lines)
444
459
 
445
 
    def install_revisions(self, target_repo):
446
 
        """Install revisions and return the target revision"""
 
460
    def install_revisions(self, target_repo, stream_input=True):
 
461
        """Install revisions and return the target revision
 
462
 
 
463
        :param target_repo: The repository to install into
 
464
        :param stream_input: Ignored by this implementation.
 
465
        """
447
466
        apply_bundle.install_bundle(target_repo, self)
448
467
        return self.target
449
468
 
 
469
    def get_merge_request(self, target_repo):
 
470
        """Provide data for performing a merge
 
471
 
 
472
        Returns suggested base, suggested target, and patch verification status
 
473
        """
 
474
        return None, self.target, 'inapplicable'
 
475
 
450
476
 
451
477
class BundleTree(Tree):
452
478
    def __init__(self, base_tree, revision_id):