426
426
# revisions. We don't need to see all lines in the inventory because
427
427
# only those added in an inventory in rev X can contain a revision=X
429
for line in w.iter_lines_added_or_present_in_versions(selected_revision_ids):
430
start = line.find('file_id="')+9
431
if start < 9: continue
432
end = line.find('"', start)
434
file_id = _unescape_xml(line[start:end])
429
pb = ui.ui_factory.nested_progress_bar()
431
for line in w.iter_lines_added_or_present_in_versions(
432
selected_revision_ids, pb=pb):
433
start = line.find('file_id="')+9
434
if start < 9: continue
435
end = line.find('"', start)
437
file_id = _unescape_xml(line[start:end])
436
start = line.find('revision="')+10
437
if start < 10: continue
438
end = line.find('"', start)
440
revision_id = _unescape_xml(line[start:end])
441
if revision_id in selected_revision_ids:
442
result.setdefault(file_id, set()).add(revision_id)
439
start = line.find('revision="')+10
440
if start < 10: continue
441
end = line.find('"', start)
443
revision_id = _unescape_xml(line[start:end])
444
if revision_id in selected_revision_ids:
445
result.setdefault(file_id, set()).add(revision_id)
2306
2311
self.new_inventory, self._config)
2307
2312
return self._new_revision_id
2314
def revision_tree(self):
2315
"""Return the tree that was just committed.
2317
After calling commit() this can be called to get a RevisionTree
2318
representing the newly committed tree. This is preferred to
2319
calling Repository.revision_tree() because that may require
2320
deserializing the inventory, while we already have a copy in
2323
return RevisionTree(self.repository, self.new_inventory,
2324
self._new_revision_id)
2309
2326
def finish_inventory(self):
2310
2327
"""Tell the builder that the inventory is finished."""
2311
2328
if self.new_inventory.root is None:
2368
2385
# In this revision format, root entries have no knit or weave
2369
2386
if ie is self.new_inventory.root:
2370
if len(parent_invs) > 0 and parent_invs[0].root is not None:
2371
ie.revision = parent_invs[0].root.revision
2387
# When serializing out to disk and back in
2388
# root.revision is always _new_revision_id
2389
ie.revision = self._new_revision_id
2375
2391
previous_entries = ie.find_previous_heads(