/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

Fix tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2007 Canonical Ltd
 
2
# Copyright (C) 2009 Jelmer Vernooij <jelmer@samba.org>
2
3
#
3
4
# This program is free software; you can redistribute it and/or modify
4
5
# it under the terms of the GNU General Public License as published by
78
79
    def supports_tags(self):
79
80
        return True
80
81
 
 
82
    def make_tags(self, branch):
 
83
        return GitTagDict(branch)
 
84
 
81
85
 
82
86
class GitBranch(ForeignBranch):
83
87
    """An adapter to git repositories for bzr Branch objects."""
84
88
 
85
89
    def __init__(self, bzrdir, repository, name, head, lockfiles):
86
90
        self.repository = repository
 
91
        self._format = GitBranchFormat()
87
92
        super(GitBranch, self).__init__(repository.get_mapping())
88
93
        self.control_files = lockfiles
89
94
        self.bzrdir = bzrdir
90
95
        self.name = name
91
96
        self.head = head
92
97
        self.base = bzrdir.transport.base
93
 
        self._format = GitBranchFormat()
94
98
 
95
99
    def dpull(self, source, stop_revision=None):
96
100
        if stop_revision is None:
157
161
        checkout_branch.pull(self, stop_revision=revision_id)
158
162
        return checkout.create_workingtree(revision_id, hardlink=hardlink)
159
163
 
160
 
    def _make_tags(self):
161
 
        return GitTagDict(self)
162
 
 
163
164
    def _gen_revision_history(self):
164
165
        if self.head is None:
165
166
            return []
183
184
    def supports_tags(self):
184
185
        return True
185
186
 
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
187
 
194
188
class InterGitGenericBranch(branch.InterBranch):
195
189
 
201
195
        graph=None):
202
196
        """See InterBranch.update_revisions()."""
203
197
        # TODO: stop_revision, overwrite
204
 
        interrepo = repository.InterRepository.get(self.source.repository, self.target.repository)
 
198
        interrepo = repository.InterRepository.get(self.source.repository, 
 
199
            self.target.repository)
205
200
        self._last_revid = None
206
201
        def determine_wants(heads):
207
202
            if not self.source.name in heads: