# HG changeset patch # User Thomas Arendsen Hein # Date 1142675121 -3600 # Node ID ce127cb4ee6edeea55dab9db6fd7529d935aaaa5 # Parent 915b81a35e46147dac7e0c83209c27bc634b7ef0 Documented behaviour of write_bundle regarding file handles. diff -r 915b81a35e46 -r ce127cb4ee6e mercurial/commands.py --- 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)