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

Actually use foreign branch utility code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Converters, etc for going between Bazaar and Git ids."""
18
18
 
19
 
class BzrGitMapping(object):
 
19
from bzrlib.plugins.git import foreign
 
20
 
 
21
class BzrGitMapping(foreign.VcsMapping):
20
22
    """Class that maps between Git and Bazaar semantics."""
21
23
    experimental = False
22
 
    namespace = None
23
24
 
24
25
    def convert_revision_id_git_to_bzr(self, git_rev_id):
25
26
        """Convert a git revision id handle to a Bazaar revision id."""
26
 
        return "%s:%s" % (self.namespace, git_rev_id)
 
27
        return "%s:%s" % (self.revid_prefix, git_rev_id)
27
28
 
28
29
    def convert_revision_id_bzr_to_git(self, bzr_rev_id):
29
30
        """Convert a Bazaar revision id to a git revision id handle."""
30
31
        assert bzr_rev_id.startswith("%s:" % self.namespace)
31
 
        return bzr_rev_id[len(self.namespace)+1:]
 
32
        return bzr_rev_id[len(self.revid_prefix)+1:]
32
33
 
33
34
 
34
35
class BzrGitMappingExperimental(BzrGitMapping):