# HG changeset patch # User Thomas Arendsen Hein # Date 1161969897 -7200 # Node ID 3bab1fc0ab7545bb18109db151560c5eca05a7c0 # Parent ca24144ed850fcdc62600c7ec97f66adf53b9935 Turn bundle file into a string for http push, for urllib2 over proxies. diff --git a/mercurial/httprepo.py b/mercurial/httprepo.py --- a/mercurial/httprepo.py +++ b/mercurial/httprepo.py @@ -221,6 +221,12 @@ class httprepository(remoterepository): qs = '?%s' % urllib.urlencode(q) cu = "%s%s" % (self._url, qs) try: + if data: + if isinstance(data, file): + # urllib2 needs string or buffer when using a proxy + data.seek(0) + data = data.read() + self.ui.debug(_("sending %d bytes\n") % len(data)) resp = urllib2.urlopen(urllib2.Request(cu, data, headers)) except urllib2.HTTPError, inst: if inst.code == 401: