~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/foreign.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-20 11:42:59 UTC
  • mfrom: (4747.2.2 foreign-extra)
  • Revision ID: pqm@pqm.ubuntu.com-20091020114259-xxou482wvh20lhl6
(Jelmer) Add abbreviated names and a foreign revid serializer to the
        foreign vcs interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
 
125
125
    branch_format = None
126
126
 
127
 
    def __init__(self, mapping_registry):
 
127
    def __init__(self, mapping_registry, abbreviation=None):
 
128
        """Create a new foreign vcs instance.
 
129
 
 
130
        :param mapping_registry: Registry with mappings for this VCS.
 
131
        :param abbreviation: Optional abbreviation ('bzr', 'svn', 'git', etc)
 
132
        """
 
133
        self.abbreviation = abbreviation
128
134
        self.mapping_registry = mapping_registry
129
135
 
130
136
    def show_foreign_revid(self, foreign_revid):
135
141
        """
136
142
        return { }
137
143
 
 
144
    def serialize_foreign_revid(self, foreign_revid):
 
145
        """Serialize a foreign revision id for this VCS.
 
146
 
 
147
        :param foreign_revid: Foreign revision id
 
148
        :return: Bytestring with serialized revid, will not contain any 
 
149
            newlines.
 
150
        """
 
151
        raise NotImplementedError(self.serialize_foreign_revid)
 
152
 
138
153
 
139
154
class ForeignVcsRegistry(registry.Registry):
140
155
    """Registry for Foreign VCSes.