/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 object_store.py

Fix repeeling objects when determining what to send.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    StrictTestament3,
43
43
    )
44
44
 
 
45
from bzrlib.plugins.git.cache import (
 
46
    from_repository as cache_from_repository,
 
47
    )
45
48
from bzrlib.plugins.git.mapping import (
46
49
    default_mapping,
47
50
    directory_to_tree,
49
52
    mapping_registry,
50
53
    symlink_to_blob,
51
54
    )
52
 
from bzrlib.plugins.git.cache import (
53
 
    from_repository as cache_from_repository,
 
55
from bzrlib.plugins.git.unpeel_map import (
 
56
    UnpeelMap,
54
57
    )
55
58
 
56
59
import posixpath
121
124
    :param have: Revisions the target already has
122
125
    :return: Set of revisions to fetch
123
126
    """
 
127
    handled = set(have)
124
128
    todo = set()
125
129
    for rev in want:
126
 
        todo.update(graph.find_unique_ancestors(rev, have))
 
130
        extra_todo = graph.find_unique_ancestors(rev, handled)
 
131
        todo.update(extra_todo)
 
132
        handled.update(extra_todo)
127
133
    if NULL_REVISION in todo:
128
134
        todo.remove(NULL_REVISION)
129
135
    return todo
315
321
        self.abort_write_group = self._cache.idmap.abort_write_group
316
322
        self.commit_write_group = self._cache.idmap.commit_write_group
317
323
        self.tree_cache = LRUTreeCache(self.repository)
 
324
        self.unpeel_map = UnpeelMap.from_repository(self.repository)
318
325
 
319
326
    def _update_sha_map(self, stop_revision=None):
320
327
        if not self.is_locked():
676
683
        processed = set()
677
684
        ret = self.lookup_git_shas(have + want)
678
685
        for commit_sha in have:
 
686
            commit_sha = self.unpeel_map.peel_tag(commit_sha, commit_sha)
679
687
            try:
680
688
                for (type, type_data) in ret[commit_sha]:
681
689
                    assert type == "commit"
682
690
                    processed.add(type_data[0])
683
691
            except KeyError:
684
 
                pass
 
692
                trace.mutter("unable to find remote ref %s", commit_sha)
685
693
        pending = set()
686
694
        for commit_sha in want:
687
695
            if commit_sha in have: