73
74
added text, reducing memory and object pressure.
77
def __init__(self, repository, parents, config, timestamp=None,
78
timezone=None, committer=None, revprops=None,
80
CommitBuilder.__init__(self, repository, parents, config,
81
timestamp=timestamp, timezone=timezone, committer=committer,
82
revprops=revprops, revision_id=revision_id)
83
self._file_graph = Graph(
84
repository._pack_collection.text_index.combined_index)
76
86
def _add_text_to_weave(self, file_id, new_lines, parents, nostore_sha):
77
87
return self.repository._pack_collection._add_text_to_weave(file_id,
78
88
self._new_revision_id, new_lines, parents, nostore_sha,
91
def _heads(self, file_id, revision_ids):
92
keys = [(file_id, revision_id) for revision_id in revision_ids]
93
return set([key[1] for key in self._file_graph.heads(keys)])
82
96
class PackRootCommitBuilder(RootCommitBuilder):
83
97
"""A subclass of RootCommitBuilder to add texts with pack semantics.
86
100
added text, reducing memory and object pressure.
103
def __init__(self, repository, parents, config, timestamp=None,
104
timezone=None, committer=None, revprops=None,
106
CommitBuilder.__init__(self, repository, parents, config,
107
timestamp=timestamp, timezone=timezone, committer=committer,
108
revprops=revprops, revision_id=revision_id)
109
self._file_graph = Graph(
110
repository._pack_collection.text_index.combined_index)
89
112
def _add_text_to_weave(self, file_id, new_lines, parents, nostore_sha):
90
113
return self.repository._pack_collection._add_text_to_weave(file_id,
91
114
self._new_revision_id, new_lines, parents, nostore_sha,
92
115
self.random_revid)
117
def _heads(self, file_id, revision_ids):
118
keys = [(file_id, revision_id) for revision_id in revision_ids]
119
return set([key[1] for key in self._file_graph.heads(keys)])
95
122
class Pack(object):
96
123
"""An in memory proxy for a pack and its indices.
719
746
pb = ui.ui_factory.nested_progress_bar()
721
return self._do_copy_nodes_graph(nodes, index_map, writer,
722
write_index, output_lines, pb)
748
for result in self._do_copy_nodes_graph(nodes, index_map, writer,
749
write_index, output_lines, pb):
752
# Python 2.4 does not permit try:finally: in a generator.
726
758
def _do_copy_nodes_graph(self, nodes, index_map, writer, write_index,