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

Extract unusual file modes from revision when reconstructing Trees.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from bzrlib.plugins.git.errors import (
30
30
    NoPushSupport,
31
31
    )
 
32
from bzrlib.plugins.git.mapping import (
 
33
    extract_unusual_modes,
 
34
    )
32
35
from bzrlib.plugins.git.object_store import (
33
36
    BazaarObjectStore,
34
37
    )
89
92
 
90
93
        """
91
94
        inv = self.source.get_inventory(revid)
 
95
        rev = self.source.get_revision(revid)
 
96
        unusual_modes = extract_unusual_modes(rev)
92
97
        todo = [inv.root]
93
98
        tree_sha = None
94
99
        while todo:
95
100
            ie = todo.pop()
96
 
            (sha, object) = self._object_store._get_ie_object_or_sha1(ie, inv)
 
101
            (sha, object) = self._object_store._get_ie_object_or_sha1(ie, inv, unusual_modes)
97
102
            if ie.parent_id is None:
98
103
                tree_sha = sha
99
104
            if not self.need_sha(sha):
102
107
            if ie.kind == "directory":
103
108
                todo.extend(ie.children.values())
104
109
        assert tree_sha is not None
105
 
        commit = self._object_store._get_commit(revid, tree_sha)
 
110
        commit = self._object_store._get_commit(rev, tree_sha)
106
111
        self.queue(commit.id, commit, None)
107
112
        return commit.id
108
113