comparison mercurial/hg.py @ 217:e6d6497a6331

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-----
author mpm@selenic.com
date Wed, 01 Jun 2005 15:21:53 -0800
parents 201115f2859b
children 3113a94c1bff
comparison
equal deleted inserted replaced
216:201115f2859b 217:e6d6497a6331
931 return urllib.urlopen(cu) 931 return urllib.urlopen(cu)
932 932
933 def branches(self, nodes): 933 def branches(self, nodes):
934 n = " ".join(map(hex, nodes)) 934 n = " ".join(map(hex, nodes))
935 d = self.do_cmd("branches", nodes=n).read() 935 d = self.do_cmd("branches", nodes=n).read()
936 br = [ tuple(map(bin, b.split(" "))) for b in d.splitlines() ] 936 try:
937 return br 937 br = [ tuple(map(bin, b.split(" "))) for b in d.splitlines() ]
938 return br
939 except:
940 self.ui.warn("unexpected response:\n" + d[:400] + "\n...\n")
941 raise
938 942
939 def between(self, pairs): 943 def between(self, pairs):
940 n = "\n".join(["-".join(map(hex, p)) for p in pairs]) 944 n = "\n".join(["-".join(map(hex, p)) for p in pairs])
941 d = self.do_cmd("between", pairs=n).read() 945 d = self.do_cmd("between", pairs=n).read()
942 p = [ l and map(bin, l.split(" ")) or [] for l in d.splitlines() ] 946 try:
943 return p 947 p = [ l and map(bin, l.split(" ")) or [] for l in d.splitlines() ]
948 return p
949 except:
950 self.ui.warn("unexpected response:\n" + d[:400] + "\n...\n")
951 raise
944 952
945 def changegroup(self, nodes): 953 def changegroup(self, nodes):
946 n = " ".join(map(hex, nodes)) 954 n = " ".join(map(hex, nodes))
947 zd = zlib.decompressobj() 955 zd = zlib.decompressobj()
948 f = self.do_cmd("changegroup", roots=n) 956 f = self.do_cmd("changegroup", roots=n)