diff -r a881a058823c -r 8a0fca925992 mercurial/hg.py --- a/mercurial/hg.py Mon May 02 00:04:49 2011 +0200 +++ b/mercurial/hg.py Mon May 02 12:36:23 2011 +0200 @@ -427,14 +427,13 @@ if revs: revs = [other.lookup(rev) for rev in revs] - other, common, anyinc, bundle = bundlerepo.getremotechanges(ui, repo, other, - revs, opts["bundle"], opts["force"]) - if not anyinc: - ui.status(_("no changes found\n")) - return subreporecurse() + other, chlist, cleanupfn = bundlerepo.getremotechanges(ui, repo, other, + revs, opts["bundle"], opts["force"]) + try: + if not chlist: + ui.status(_("no changes found\n")) + return subreporecurse() - try: - chlist = other.changelog.findmissing(common, revs) displayer = cmdutil.show_changeset(ui, other, opts, buffered) # XXX once graphlog extension makes it into core, @@ -443,10 +442,7 @@ displayer.close() finally: - if hasattr(other, 'close'): - other.close() - if bundle: - os.unlink(bundle) + cleanupfn() subreporecurse() return 0 # exit code is zero since we found incoming changes