# HG changeset patch # User mpm@selenic.com # Date 1117668113 28800 # Node ID e6d6497a6331cbb1e01c1b717cf01ee5a065b43b # Parent 201115f2859b91ec7019c1e468b14367feebe9cc merge: catch unexpected responses -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 merge: catch unexpected responses This dumps the data received from the remote server in case we fail to parse its output. manifest hash: da5232649a0e02645bccd8b50665d9c3e247fdc2 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCnkMRywK+sNU5EO8RApAGAKCw7ZHF4YUaTi3ychbUe5Lr47OsCwCfUqKg lxA/sgDmeDMbmwbV5S+Beik= =y6TB -----END PGP SIGNATURE----- diff -r 201115f2859b -r e6d6497a6331 mercurial/hg.py --- a/mercurial/hg.py Wed Jun 01 15:15:07 2005 -0800 +++ b/mercurial/hg.py Wed Jun 01 15:21:53 2005 -0800 @@ -933,14 +933,22 @@ def branches(self, nodes): n = " ".join(map(hex, nodes)) d = self.do_cmd("branches", nodes=n).read() - br = [ tuple(map(bin, b.split(" "))) for b in d.splitlines() ] - return br + try: + br = [ tuple(map(bin, b.split(" "))) for b in d.splitlines() ] + return br + except: + self.ui.warn("unexpected response:\n" + d[:400] + "\n...\n") + raise def between(self, pairs): n = "\n".join(["-".join(map(hex, p)) for p in pairs]) d = self.do_cmd("between", pairs=n).read() - p = [ l and map(bin, l.split(" ")) or [] for l in d.splitlines() ] - return p + try: + p = [ l and map(bin, l.split(" ")) or [] for l in d.splitlines() ] + return p + except: + self.ui.warn("unexpected response:\n" + d[:400] + "\n...\n") + raise def changegroup(self, nodes): n = " ".join(map(hex, nodes))