Cleaned up the code path for bundle handling in hg incoming, updated comments.
--- a/mercurial/commands.py Sat Mar 18 10:45:21 2006 +0100
+++ b/mercurial/commands.py Sat Mar 18 11:24:19 2006 +0100
@@ -1782,23 +1782,22 @@
return
cleanup = None
- if not other.local() or opts["bundle"]:
- # create an uncompressed bundle
- if not opts["bundle"]:
- # create a temporary bundle
- fd, fname = tempfile.mkstemp(suffix=".hg",
- prefix="tmp-hg-incoming")
- f = os.fdopen(fd, "wb")
- cleanup = fname
- else:
- fname = opts["bundle"]
- f = open(fname, "wb")
-
+ fname = opts["bundle"]
+ if fname:
+ # create a bundle (uncompressed if other repo is not local)
+ f = open(fname, "wb")
+ elif not other.local():
+ # create an uncompressed temporary bundle
+ fd, fname = tempfile.mkstemp(suffix=".hg", prefix="hg-incoming-")
+ f = os.fdopen(fd, "wb")
+ cleanup = fname
+
+ if fname:
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
+ # use the created uncompressed bundlerepo
other = bundlerepo.bundlerepository(ui, repo.root, fname)
o = other.changelog.nodesbetween(incoming)[0]