/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

Implement Tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
    def supports_tags(self):
79
79
        return True
80
80
 
 
81
    def make_tags(self, branch):
 
82
        return GitTagDict(branch)
 
83
 
81
84
 
82
85
class GitBranch(ForeignBranch):
83
86
    """An adapter to git repositories for bzr Branch objects."""
84
87
 
85
88
    def __init__(self, bzrdir, repository, name, head, lockfiles):
86
89
        self.repository = repository
 
90
        self._format = GitBranchFormat()
87
91
        super(GitBranch, self).__init__(repository.get_mapping())
88
92
        self.control_files = lockfiles
89
93
        self.bzrdir = bzrdir
90
94
        self.name = name
91
95
        self.head = head
92
96
        self.base = bzrdir.transport.base
93
 
        self._format = GitBranchFormat()
94
97
 
95
98
    def dpull(self, source, stop_revision=None):
96
99
        if stop_revision is None:
157
160
        checkout_branch.pull(self, stop_revision=revision_id)
158
161
        return checkout.create_workingtree(revision_id, hardlink=hardlink)
159
162
 
160
 
    def _make_tags(self):
161
 
        return GitTagDict(self)
162
 
 
163
163
    def _gen_revision_history(self):
164
164
        if self.head is None:
165
165
            return []
183
183
    def supports_tags(self):
184
184
        return True
185
185
 
186
 
    def sprout(self, to_bzrdir, revision_id=None):
187
 
        """See Branch.sprout()."""
188
 
        result = to_bzrdir.create_branch()
189
 
        self.copy_content_into(result, revision_id=revision_id)
190
 
        result.set_parent(self.bzrdir.root_transport.base)
191
 
        return result
192
 
 
193
186
 
194
187
class InterGitGenericBranch(branch.InterBranch):
195
188
 
201
194
        graph=None):
202
195
        """See InterBranch.update_revisions()."""
203
196
        # TODO: stop_revision, overwrite
204
 
        interrepo = repository.InterRepository.get(self.source.repository, self.target.repository)
 
197
        interrepo = repository.InterRepository.get(self.source.repository, 
 
198
            self.target.repository)
205
199
        self._last_revid = None
206
200
        def determine_wants(heads):
207
201
            if not self.source.name in heads: