def runtest() : py_res_1 = py_parseindex(data_inlined, True) c_res_1 = parsers.parse_index2(data_inlined, True) py_res_2 = py_parseindex(data_non_inlined, False) c_res_2 = parsers.parse_index2(data_non_inlined, False) if py_res_1 != c_res_1: print "Parse index result (with inlined data) differs!" if py_res_2 != c_res_2: print "Parse index result (no inlined data) differs!" print "done"
def runtest(): py_res_1 = py_parseindex(data_inlined, True) c_res_1 = parse_index2(data_inlined, True) py_res_2 = py_parseindex(data_non_inlined, False) c_res_2 = parse_index2(data_non_inlined, False) if py_res_1 != c_res_1: print "Parse index result (with inlined data) differs!" if py_res_2 != c_res_2: print "Parse index result (no inlined data) differs!" ix = parsers.parse_index2(data_inlined, True)[0] for i, r in enumerate(ix): if r[7] == nullid: i = -1 try: if ix[r[7]] != i: print 'Reverse lookup inconsistent for %r' % r[7].encode('hex') except TypeError: # pure version doesn't support this break print "done"
def runtest() : py_res_1 = py_parseindex(data_inlined, True) c_res_1 = parse_index2(data_inlined, True) py_res_2 = py_parseindex(data_non_inlined, False) c_res_2 = parse_index2(data_non_inlined, False) if py_res_1 != c_res_1: print "Parse index result (with inlined data) differs!" if py_res_2 != c_res_2: print "Parse index result (no inlined data) differs!" ix = parsers.parse_index2(data_inlined, True)[0] for i, r in enumerate(ix): if r[7] == nullid: i = -1 try: if ix[r[7]] != i: print 'Reverse lookup inconsistent for %r' % r[7].encode('hex') except TypeError: # pure version doesn't support this break print "done"
def runtest(): # Only test the version-detection logic if it is present. try: parsers.versionerrortext except AttributeError: pass else: runversiontests() # Check that parse_index2() raises TypeError on bad arguments. try: parse_index2(0, True) except TypeError: pass else: print("Expected to get TypeError.") # Check parsers.parse_index2() on an index file against the original # Python implementation of parseindex, both with and without inlined data. py_res_1 = py_parseindex(data_inlined, True) c_res_1 = parse_index2(data_inlined, True) py_res_2 = py_parseindex(data_non_inlined, False) c_res_2 = parse_index2(data_non_inlined, False) if py_res_1 != c_res_1: print("Parse index result (with inlined data) differs!") if py_res_2 != c_res_2: print("Parse index result (no inlined data) differs!") ix = parsers.parse_index2(data_inlined, True)[0] for i, r in enumerate(ix): if r[7] == nullid: i = -1 try: if ix[r[7]] != i: print('Reverse lookup inconsistent for %r' % r[7].encode('hex')) except TypeError: # pure version doesn't support this break print("done")
def runtest() : # Only test the version-detection logic if it is present. try: parsers.versionerrortext except AttributeError: pass else: runversiontests() # Check that parse_index2() raises TypeError on bad arguments. try: parse_index2(0, True) except TypeError: pass else: print "Expected to get TypeError." # Check parsers.parse_index2() on an index file against the original # Python implementation of parseindex, both with and without inlined data. py_res_1 = py_parseindex(data_inlined, True) c_res_1 = parse_index2(data_inlined, True) py_res_2 = py_parseindex(data_non_inlined, False) c_res_2 = parse_index2(data_non_inlined, False) if py_res_1 != c_res_1: print "Parse index result (with inlined data) differs!" if py_res_2 != c_res_2: print "Parse index result (no inlined data) differs!" ix = parsers.parse_index2(data_inlined, True)[0] for i, r in enumerate(ix): if r[7] == nullid: i = -1 try: if ix[r[7]] != i: print 'Reverse lookup inconsistent for %r' % r[7].encode('hex') except TypeError: # pure version doesn't support this break print "done"
def parse_index2(data, inline): index, chunkcache = parsers.parse_index2(data, inline) return list(index), chunkcache