archive: delay extraction of file revisions
This allows us to look only at the filelogs we're interested in,
providing a nice speedup if we're archiving only part of a repository.
--- a/mercurial/archival.py Thu Jul 19 19:43:25 2007 -0300
+++ b/mercurial/archival.py Thu Jul 19 19:43:25 2007 -0300
@@ -200,8 +200,9 @@
prefix is name of path to put before every archive member.'''
- def write(name, mode, islink, data):
+ def write(name, mode, islink, getdata):
if matchfn and not matchfn(name): return
+ data = getdata()
if decode:
data = repo.wwritedata(name, data)
archiver.addfile(name, mode, islink, data)
@@ -212,8 +213,8 @@
items = m.items()
items.sort()
write('.hg_archival.txt', 0644, False,
- 'repo: %s\nnode: %s\n' % (hex(repo.changelog.node(0)), hex(node)))
+ lambda: 'repo: %s\nnode: %s\n' % (hex(repo.changelog.node(0)), hex(node)))
for filename, filenode in items:
write(filename, m.execf(filename) and 0755 or 0644, m.linkf(filename),
- repo.file(filename).read(filenode))
+ lambda: repo.file(filename).read(filenode))
archiver.done()