Documented behaviour of write_bundle regarding file handles.
--- a/mercurial/commands.py Sat Mar 18 09:13:27 2006 +0100
+++ b/mercurial/commands.py Sat Mar 18 10:45:21 2006 +0100
@@ -275,6 +275,10 @@
mode)
def write_bundle(cg, filename, compress=True, fh=None):
+ """Write a bundle file, optionally without bz2 compression.
+
+ A file handle (fh) may be passed and is guaranteed to be closed.
+ """
if fh is None:
fh = open(filename, "wb")
@@ -1792,6 +1796,7 @@
cg = other.changegroup(incoming, "incoming")
write_bundle(cg, fname, compress=other.local(), fh=f)
+ # write_bundle closed f for us.
if not other.local():
# use a bundlerepo
other = bundlerepo.bundlerepository(ui, repo.root, fname)