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

Fix lock_write argument.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    branch,
21
21
    config,
22
22
    revision,
 
23
    tag,
23
24
    )
24
25
from bzrlib.decorators import needs_read_lock
25
26
 
26
27
from bzrlib.plugins.git import ids
27
28
 
 
29
class GitTagDict(tag.BasicTags):
 
30
 
 
31
    def __init__(self, repository):
 
32
        self.repository = repository
 
33
 
 
34
    def get_tag_dict(self):
 
35
        ret = {}
 
36
        for tag in self.repository._git.tags:
 
37
            ret[tag.name] = ids.convert_revision_id_git_to_bzr(tag.commit.id)
 
38
        return ret
 
39
 
28
40
 
29
41
class GitBranchConfig(config.BranchConfig):
30
42
    """BranchConfig that uses locations.conf in place of branch.conf"""
44
56
    def get_format_description(self):
45
57
        return 'Git Branch'
46
58
 
 
59
    def supports_tags(self):
 
60
        return True
 
61
 
47
62
 
48
63
class GitBranch(branch.Branch):
49
64
    """An adapter to git repositories for bzr Branch objects."""
50
65
 
51
66
    def __init__(self, bzrdir, repository, head, base, lockfiles):
 
67
        self.repository = repository
52
68
        super(GitBranch, self).__init__()
53
69
        self.control_files = lockfiles
54
70
        self.bzrdir = bzrdir
55
 
        self.repository = repository
56
71
        self.head = head
57
72
        self.base = base
58
73
        self._format = GitBranchFormat()
67
82
            return revision.NULL_REVISION
68
83
        return ids.convert_revision_id_git_to_bzr(self.head)
69
84
 
 
85
    def _make_tags(self):
 
86
        return GitTagDict(self.repository)
 
87
 
70
88
    def get_parent(self):
71
89
        """See Branch.get_parent()."""
72
90
        return None
118
136
                                          local=True)
119
137
 
120
138
    def supports_tags(self):
121
 
        return False
 
139
        return True