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

Use bzr-foreign function names for converting between git and bzr revids.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    )
25
25
from bzrlib.decorators import needs_read_lock
26
26
 
27
 
from bzrlib.plugins.git.foreign import ForeignBranch
28
27
from bzrlib.plugins.git.mapping import default_mapping
29
28
 
30
29
class GitTagDict(tag.BasicTags):
36
35
    def get_tag_dict(self):
37
36
        ret = {}
38
37
        for tag in self.repository._git.tags:
39
 
            ret[tag.name] = self.branch.mapping.revision_id_foreign_to_bzr(tag.ref)
 
38
            ret[tag.name] = default_mapping.revision_id_foreign_to_bzr(tag.commit.id)
40
39
        return ret
41
40
 
42
41
    def set_tag(self, name, revid):
65
64
        return True
66
65
 
67
66
 
68
 
class GitBranch(ForeignBranch):
 
67
class GitBranch(branch.Branch):
69
68
    """An adapter to git repositories for bzr Branch objects."""
70
69
 
71
70
    def __init__(self, bzrdir, repository, head, base, lockfiles):
72
71
        self.repository = repository
73
 
        super(GitBranch, self).__init__(default_mapping)
 
72
        super(GitBranch, self).__init__()
74
73
        self.control_files = lockfiles
75
74
        self.bzrdir = bzrdir
76
75
        self.head = head
85
84
        # perhaps should escape this ?
86
85
        if self.head is None:
87
86
            return revision.NULL_REVISION
88
 
        return self.mapping.revision_id_foreign_to_bzr(self.head)
 
87
        return default_mapping.revision_id_foreign_to_bzr(self.head)
89
88
 
90
89
    def _make_tags(self):
91
90
        return GitTagDict(self)
110
109
            skip += max_count
111
110
            for cm in cms:
112
111
                if cm.id == nextid:
113
 
                    ret.append(self.mapping.revision_id_foreign_to_bzr(cm.id))
 
112
                    ret.append(default_mapping.revision_id_foreign_to_bzr(cm.id))
114
113
                    if cm.parents == []:
115
114
                        nextid = None
116
115
                    else: