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

Add assert demonstrating 571055 and triggering it for all target formats.

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
 
194
194
def remove_disappeared_children(base_inv, path, base_tree, existing_children,
195
195
        lookup_object):
 
196
    """Generate an inventory delta for removed children.
 
197
 
 
198
    :param base_inv: Base inventory against which to generate the 
 
199
        inventory delta.
 
200
    :param path: Path to process
 
201
    :param base_tree: Git Tree base object
 
202
    :param existing_children: Children that still exist
 
203
    :param lookup_object: Lookup a git object by its SHA1
 
204
    :return: Inventory delta, as list
 
205
    """
196
206
    ret = []
197
207
    for name, mode, hexsha in base_tree.iteritems():
198
208
        if name in existing_children:
199
209
            continue
200
210
        c_path = posixpath.join(path, name.decode("utf-8"))
201
 
        ret.append((c_path, None, base_inv.path2id(c_path), None))
 
211
        file_id = base_inv.path2id(c_path)
 
212
        assert file_id is not None
 
213
        ret.append((c_path, None, file_id, None))
202
214
        if stat.S_ISDIR(mode):
203
215
            ret.extend(remove_disappeared_children(
204
216
                base_inv, c_path, lookup_object(hexsha), [], lookup_object))