/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

Add some more format tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    NoSuchRef,
49
49
    )
50
50
from bzrlib.plugins.git.refs import (
51
 
    branch_name_to_ref,
52
51
    ref_to_branch_name,
53
52
    extract_tags,
54
53
    tag_name_to_ref,
58
57
 
59
58
 
60
59
class GitPullResult(branch.PullResult):
 
60
    """Result of a pull from a Git branch."""
61
61
 
62
62
    def _lookup_revno(self, revid):
63
63
        assert isinstance(revid, str), "was %r" % revid
108
108
        for name in extra:
109
109
            if name.startswith("refs/tags/"):
110
110
                del self.repository._git[name]
111
 
        
 
111
 
112
112
    def set_tag(self, name, revid):
113
113
        self.repository._git.refs[tag_name_to_ref(name)], _ = \
114
114
            self.branch.mapping.revision_id_bzr_to_foreign(revid)
251
251
            overwrite, stop_revision)
252
252
 
253
253
    def lookup_foreign_revision_id(self, foreign_revid):
254
 
        return self.repository.lookup_foreign_revision_id(foreign_revid, 
 
254
        return self.repository.lookup_foreign_revision_id(foreign_revid,
255
255
            self.mapping)
256
256
 
257
257
 
259
259
    """A local Git branch."""
260
260
 
261
261
    def __init__(self, bzrdir, repository, name, lockfiles, tagsdict=None):
262
 
        super(LocalGitBranch, self).__init__(bzrdir, repository, name, 
 
262
        super(LocalGitBranch, self).__init__(bzrdir, repository, name,
263
263
              lockfiles, tagsdict)
264
264
        refs = repository._git.get_refs()
265
265
        if not (name in refs.keys() or "HEAD" in refs.keys()):
342
342
 
343
343
    def supports_tags(self):
344
344
        return True
345
 
    
 
345
 
346
346
 
347
347
class GitBranchPullResult(branch.PullResult):
348
348
 
389
389
 
390
390
    def _set_new_revno(self, revno):
391
391
        self._new_revno = revno
392
 
    
 
392
 
393
393
    new_revno = property(_get_new_revno, _set_new_revno)
394
394
 
395
395