/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 common base class for tags.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
        return self._lookup_revno(self.new_revid)
79
79
 
80
80
 
81
 
class LocalGitTagDict(tag.BasicTags):
82
 
    """Dictionary with tags in a local repository."""
 
81
class GitTags(tag.BasicTags):
 
82
    """Ref-based tag dictionary."""
83
83
 
84
84
    def __init__(self, branch):
85
85
        self.branch = branch
86
86
        self.repository = branch.repository
87
87
 
 
88
 
 
89
class LocalGitTagDict(GitTags):
 
90
    """Dictionary with tags in a local repository."""
 
91
 
 
92
    def __init__(self, branch):
 
93
        super(LocalGitTagDict, self).__init__(branch)
 
94
        self.refs = self.repository._git.refs
 
95
 
88
96
    def get_tag_dict(self):
89
97
        ret = {}
90
98
        refs = self.repository._git.get_refs()
119
127
                del self.repository._git[name]
120
128
 
121
129
    def set_tag(self, name, revid):
122
 
        self.repository._git.refs[tag_name_to_ref(name)], _ = \
 
130
        self.refs[tag_name_to_ref(name)], _ = \
123
131
            self.branch.lookup_bzr_revision_id(revid)
124
132
 
125
133