33
def export_archive(history, root, revid, format=".tar.gz"):
22
34
"""Export tree contents to an archive
24
36
:param history: Instance of history to export
25
38
:param revid: Revision to export
26
39
:param format: Format of the archive
28
41
fileobj = ExporterFileObject()
29
42
tree = history._branch.repository.revision_tree(revid)
43
for _ in get_export_generator(tree=tree, root=root, fileobj=fileobj, format=format):
31
44
yield fileobj.get_buffer()
32
45
# Might have additonal contents written
33
46
yield fileobj.get_buffer()