1166
1166
t in self.revision_trees(required_trees))
1167
1167
for revision in revisions:
1168
1168
if not revision.parent_ids:
1169
old_tree = self.revision_tree(None)
1169
old_tree = self.revision_tree(_mod_revision.NULL_REVISION)
1171
1171
old_tree = trees[revision.parent_ids[0]]
1172
1172
yield trees[revision.revision_id].changes_from(old_tree)
1658
1658
def revision_tree(self, revision_id):
1659
1659
"""Return Tree for a revision on this branch.
1661
`revision_id` may be None for the empty tree revision.
1661
`revision_id` may be NULL_REVISION for the empty tree revision.
1663
revision_id = _mod_revision.ensure_null(revision_id)
1663
1664
# TODO: refactor this to use an existing revision object
1664
1665
# so we don't need to read it in twice.
1665
if revision_id is None or revision_id == _mod_revision.NULL_REVISION:
1666
if revision_id == _mod_revision.NULL_REVISION:
1666
1667
return RevisionTree(self, Inventory(root_id=None),
1667
1668
_mod_revision.NULL_REVISION)
1959
1960
present_parents.append(p_id)
1960
1961
parent_trees[p_id] = repository.revision_tree(p_id)
1962
parent_trees[p_id] = repository.revision_tree(None)
1963
parent_trees[p_id] = repository.revision_tree(
1964
_mod_revision.NULL_REVISION)
1964
1966
inv = revision_tree.inventory
1965
1967
entries = inv.iter_entries()
2916
2918
RepositoryFormatPackDevelopment1,
2917
2919
RepositoryFormatPackDevelopment1Subtree,
2920
RepositoryFormatKnit1,
2921
RepositoryFormatKnitPack1,
2922
RepositoryFormatPackDevelopment1,
2923
RepositoryFormatKnitPack4,
2924
RepositoryFormatKnitPack5,
2925
RepositoryFormatKnitPack5RichRoot,
2928
RepositoryFormatKnit3,
2929
RepositoryFormatKnitPack3,
2930
RepositoryFormatPackDevelopment1Subtree,
2932
return (isinstance(source._format, nosubtrees) and
2933
isinstance(target._format, subtrees))
2922
RepositoryFormatKnit1, # no rr, no subtree
2923
RepositoryFormatKnitPack1, # no rr, no subtree
2924
RepositoryFormatPackDevelopment1, # no rr, no subtree
2925
RepositoryFormatKnitPack5, # no rr, no subtree
2928
RepositoryFormatKnit3, # rr, subtree
2929
RepositoryFormatKnitPack3, # rr, subtree
2930
RepositoryFormatKnitPack4, # rr, no subtree
2931
RepositoryFormatKnitPack5RichRoot,# rr, no subtree
2932
RepositoryFormatPackDevelopment1Subtree, # rr, subtree
2934
for format in norichroot:
2935
if format.rich_root_data:
2936
raise AssertionError('Format %s is a rich-root format'
2937
' but is included in the non-rich-root list'
2939
for format in richroot:
2940
if not format.rich_root_data:
2941
raise AssertionError('Format %s is not a rich-root format'
2942
' but is included in the rich-root list'
2944
# TODO: One alternative is to just check format.rich_root_data,
2945
# instead of keeping membership lists. However, the formats
2946
# *also* have to use the same 'Knit' style of storage
2947
# (line-deltas, fulltexts, etc.)
2948
return (isinstance(source._format, norichroot) and
2949
isinstance(target._format, richroot))
2934
2950
except AttributeError: