/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 repository.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) 2008-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
101
102
 
102
103
    def all_revision_ids(self):
103
104
        ret = set([revision.NULL_REVISION])
104
 
        if self._git.heads() == []:
 
105
        heads = self._git.heads()
 
106
        if heads == {}:
105
107
            return ret
106
 
        bzr_heads = [self.get_mapping().revision_id_foreign_to_bzr(h) for h in self._git.heads()]
 
108
        bzr_heads = [self.get_mapping().revision_id_foreign_to_bzr(h) for h in heads.itervalues()]
107
109
        ret = set(bzr_heads)
108
110
        graph = self.get_graph()
109
111
        for rev, parents in graph.iter_ancestry(bzr_heads):
139
141
        """See Repository.get_ancestry().
140
142
        """
141
143
        if revision_id is None:
142
 
            return self._all_revision_ids()
 
144
            return [None, revision.NULL_REVISION] + self._all_revision_ids()
143
145
        assert isinstance(revision_id, str)
144
146
        ancestry = []
145
147
        graph = self.get_graph()
146
148
        for rev, parents in graph.iter_ancestry([revision_id]):
147
 
            if rev == revision.NULL_REVISION:
148
 
                rev = None
149
149
            ancestry.append(rev)
150
150
        ancestry.reverse()
151
 
        return ancestry
 
151
        return [None] + ancestry
152
152
 
153
153
    def import_revision_gist(self, source, revid, parent_lookup):
154
154
        """Impor the gist of another revision into this Git repository.