~ubuntu-branches/ubuntu/maverick/bzr-git/maverick

« back to all changes in this revision

Viewing changes to repository.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2010-03-18 16:09:25 UTC
  • mfrom: (1.1.9 upstream) (8.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100318160925-p96lipgudc5iw3u5
Tags: 0.5.0-1
* New upstream release.
 + Fixes breakage with newer versions of Python 2.6.
* Bump standards version to 3.8.4.
* Switch to dpkg-source 3.0 (quilt) format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""An adapter between a Git Repository and a Bazaar Branch"""
19
19
 
20
 
import bzrlib
21
20
from bzrlib import (
22
21
    errors,
23
22
    graph,
24
23
    inventory,
25
 
    osutils,
26
24
    repository,
27
25
    revision,
28
26
    revisiontree,
41
39
    )
42
40
from bzrlib.plugins.git.tree import (
43
41
    GitRevisionTree,
44
 
    InterGitRevisionTrees,
45
42
    )
46
43
from bzrlib.plugins.git.versionedfiles import (
47
44
    GitRevisions,
73
70
    def supports_rich_root(self):
74
71
        return True
75
72
 
76
 
    def _warn_if_deprecated(self):
 
73
    def _warn_if_deprecated(self, branch=None):
77
74
        # This class isn't deprecated
78
75
        pass
79
76
 
111
108
        self.texts = GitTexts(self)
112
109
 
113
110
    def all_revision_ids(self):
114
 
        ret = set([revision.NULL_REVISION])
 
111
        ret = set([])
115
112
        heads = self._git.refs.as_dict('refs/heads')
116
113
        if heads == {}:
117
114
            return ret
165
162
    def lookup_foreign_revision_id(self, foreign_revid, mapping=None):
166
163
        """Lookup a revision id.
167
164
 
168
 
        :param revid: Bazaar revision id.
169
 
        :return: Tuple with git revisionid and mapping.
170
165
        """
171
166
        if mapping is None:
172
167
            mapping = self.get_mapping()
226
221
        progress=None):
227
222
        return self._git.fetch_objects(determine_wants, graph_walker, progress)
228
223
 
 
224
    def _get_versioned_file_checker(self, text_key_references=None,
 
225
                        ancestors=None):
 
226
        return GitVersionedFileChecker(self,
 
227
            text_key_references=text_key_references, ancestors=ancestors)
 
228
    
 
229
 
 
230
class GitVersionedFileChecker(repository._VersionedFileChecker):
 
231
 
 
232
    file_ids = []
 
233
 
 
234
    def _check_file_version_parents(self, texts, progress_bar):
 
235
        return {}, []
 
236
 
229
237
 
230
238
class GitRepositoryFormat(repository.RepositoryFormat):
231
239
    """Git repository format."""
243
251
        return target_repo_format.rich_root_data
244
252
 
245
253
    def get_foreign_tests_repository_factory(self):
246
 
        from bzrlib.plugins.git.tests.test_repository import ForeignTestsRepositoryFactory
 
254
        from bzrlib.plugins.git.tests.test_repository import (
 
255
            ForeignTestsRepositoryFactory,
 
256
            )
247
257
        return ForeignTestsRepositoryFactory()
248
258
 
249
259
    def network_name(self):