Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/httprepo.py @ 3614:fd7a018b7db7
Try hgweb unbundle methods in the order presented by the server.
If no common bundle format is found, push is aborted.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Thu, 02 Nov 2006 15:30:45 +0100 |
parents | cbf352b9a3cd |
children | e99ba8726bda |
comparison
equal
deleted
inserted
replaced
3613:cbf352b9a3cd | 3614:fd7a018b7db7 |
---|---|
348 try: | 348 try: |
349 unbundleversions = unbundleversions.split(',') | 349 unbundleversions = unbundleversions.split(',') |
350 except AttributeError: | 350 except AttributeError: |
351 unbundleversions = [""] | 351 unbundleversions = [""] |
352 | 352 |
353 if "HG10GZ" in unbundleversions: | 353 while unbundleversions: |
354 header = "HG10GZ" | 354 header = unbundleversions[0] |
355 z = zlib.compressobj() | 355 if header == "HG10GZ": |
356 else: | 356 self.ui.note(_("using zlib compression\n")) |
357 self.ui.note(_("server has no compression support, " | 357 z = zlib.compressobj() |
358 "sending uncompressed")) | 358 break |
359 header = "" | 359 elif header == "HG10UN": |
360 z = nocompress() | 360 self.ui.note(_("using no compression\n")) |
361 z = nocompress() | |
362 break | |
363 elif header == "": | |
364 self.ui.note(_("old server without compression support," | |
365 " sending uncompressed\n")) | |
366 z = nocompress() | |
367 break | |
368 unbundleversions.pop(0) | |
369 if not unbundleversions: | |
370 raise util.Abort(_("The server doesn't accept any bundle format" | |
371 " method we know.")) | |
361 | 372 |
362 fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-') | 373 fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-') |
363 fp = os.fdopen(fd, 'wb+') | 374 fp = os.fdopen(fd, 'wb+') |
364 try: | 375 try: |
365 fp.write(header) | 376 fp.write(header) |