/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

  • Committer: Jelmer Vernooij
  • Date: 2009-03-16 13:56:04 UTC
  • mto: (0.200.259 trunk)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20090316135604-9nkd7d2ztiygybiy
Strip ref directory name from tag names.

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
        if getattr(branch.repository, "get_refs", None) is not None:
 
84
            from bzrlib.plugins.git.remote import RemoteGitTagDict
 
85
            return RemoteGitTagDict(branch)
 
86
        return GitTagDict(branch)
 
87
 
81
88
 
82
89
class GitBranch(ForeignBranch):
83
90
    """An adapter to git repositories for bzr Branch objects."""
84
91
 
85
92
    def __init__(self, bzrdir, repository, name, head, lockfiles):
86
93
        self.repository = repository
 
94
        self._format = GitBranchFormat()
87
95
        super(GitBranch, self).__init__(repository.get_mapping())
88
96
        self.control_files = lockfiles
89
97
        self.bzrdir = bzrdir
90
98
        self.name = name
91
99
        self.head = head
92
100
        self.base = bzrdir.transport.base
93
 
        self._format = GitBranchFormat()
94
101
 
95
102
    def dpull(self, source, stop_revision=None):
96
103
        if stop_revision is None:
157
164
        checkout_branch.pull(self, stop_revision=revision_id)
158
165
        return checkout.create_workingtree(revision_id, hardlink=hardlink)
159
166
 
160
 
    def _make_tags(self):
161
 
        return GitTagDict(self)
162
 
 
163
167
    def _gen_revision_history(self):
164
168
        if self.head is None:
165
169
            return []
183
187
    def supports_tags(self):
184
188
        return True
185
189
 
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
190
 
194
191
class InterGitGenericBranch(branch.InterBranch):
195
192
 
201
198
        graph=None):
202
199
        """See InterBranch.update_revisions()."""
203
200
        # TODO: stop_revision, overwrite
204
 
        interrepo = repository.InterRepository.get(self.source.repository, self.target.repository)
 
201
        interrepo = repository.InterRepository.get(self.source.repository, 
 
202
            self.target.repository)
205
203
        self._last_revid = None
206
204
        def determine_wants(heads):
207
205
            if not self.source.name in heads: