/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

Simplify object generation code a bit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
    shamap = {}
129
129
    for path, ie in inv.entries():
130
130
        if ie.kind == "file":
131
 
            if ie.revision == inv.revision_id:
132
 
                new_blobs.append((path, ie))
133
 
                new_trees[urlutils.dirname(path)] = ie.parent_id
134
 
            elif has_ghost_parents:
 
131
            if ie.revision != inv.revision_id:
135
132
                for (pinv, pinvshamap) in zip(parent_invs, parent_invshamaps):
136
133
                    try:
137
134
                        pie = pinv[ie.file_id]
138
135
                    except errors.NoSuchId:
139
136
                        pass
140
137
                    else:
141
 
                        if (pie.kind == ie.kind and
142
 
                            pie.text_sha1 == ie.text_sha1):
 
138
                        if (pie.text_sha1 == ie.text_sha1 and 
 
139
                            pie.kind == ie.kind):
143
140
                            shamap[ie.file_id] = pinvshamap.lookup_blob(
144
141
                                pie.file_id, pie.revision)
145
142
                            break
146
 
                else:
147
 
                    new_blobs.append((path, ie))
148
 
                    new_trees[urlutils.dirname(path)] = ie.parent_id
 
143
            if not ie.file_id in shamap:
 
144
                new_blobs.append((path, ie))
 
145
                new_trees[urlutils.dirname(path)] = ie.parent_id
149
146
        elif ie.kind == "symlink":
150
147
            blob = symlink_to_blob(ie)
151
148
            for pinv in parent_invs: