/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

  • Committer: Jelmer Vernooij
  • Date: 2009-07-22 13:10:44 UTC
  • mfrom: (0.200.588 trunk)
  • mto: (0.200.597 trunk)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20090722131044-r30g8w06xd8f40fl
merge trunk.

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
    )
78
81
        # or already present remotely (as git doesn't do ghosts)
79
82
        return False
80
83
 
81
 
    def queue(self, sha, obj, path, ie=None, inv=None):
 
84
    def queue(self, sha, obj, path, ie=None, inv=None, unusual_modes=None):
82
85
        if obj is None:
83
 
            obj = (ie, inv)
 
86
            obj = (ie, inv, unusual_modes)
84
87
        self._pending.append((obj, path))
85
88
        self._sent_shas.add(sha)
86
89
 
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):
100
105
                continue
101
 
            self.queue(sha, object, inv.id2path(ie.file_id), ie, inv)
 
106
            self.queue(sha, object, inv.id2path(ie.file_id), ie, inv, unusual_modes)
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)
106
 
        self.queue(commit.id, commit, None)
 
110
        commit = self._object_store._get_commit(rev, tree_sha)
 
111
        self.queue(commit.id, commit, None, None)
107
112
        return commit.id
108
113
 
109
114
    def __len__(self):