Show More
@@ -490,18 +490,16 b' class httppeer(wireprotov1peer.wirepeer)' | |||
|
490 | 490 | os.unlink(tempname) |
|
491 | 491 | |
|
492 | 492 | def _calltwowaystream(self, cmd, fp, **args): |
|
493 | fh = None | |
|
494 | 493 | fp_ = None |
|
495 | 494 | filename = None |
|
496 | 495 | try: |
|
497 | 496 | # dump bundle to disk |
|
498 | 497 | fd, filename = pycompat.mkstemp(prefix="hg-bundle-", suffix=".hg") |
|
499 |
|
|
|
498 | with os.fdopen(fd, r"wb") as fh: | |
|
500 | 499 | d = fp.read(4096) |
|
501 | 500 | while d: |
|
502 | 501 | fh.write(d) |
|
503 | 502 | d = fp.read(4096) |
|
504 | fh.close() | |
|
505 | 503 | # start http push |
|
506 | 504 | fp_ = httpconnection.httpsendfile(self.ui, filename, "rb") |
|
507 | 505 | headers = {r'Content-Type': r'application/mercurial-0.1'} |
@@ -509,8 +507,7 b' class httppeer(wireprotov1peer.wirepeer)' | |||
|
509 | 507 | finally: |
|
510 | 508 | if fp_ is not None: |
|
511 | 509 | fp_.close() |
|
512 |
if f |
|
|
513 | fh.close() | |
|
510 | if filename is not None: | |
|
514 | 511 | os.unlink(filename) |
|
515 | 512 | |
|
516 | 513 | def _callcompressable(self, cmd, **args): |
General Comments 0
You need to be logged in to leave comments.
Login now