comparison hg @ 92:e6fc7ff52246

Add debugindexdot to generate graphviz dot files from indexes
author mpm@selenic.com
date Wed, 18 May 2005 15:23:10 -0800
parents 1c212bbb38d5
children 0b0efe409d79
comparison
equal deleted inserted replaced
91:1c212bbb38d5 92:e6fc7ff52246
347 e = r.index[i] 347 e = r.index[i]
348 print "% 6d % 9d % 7d % 6d % 7d %s.. %s.. %s.." % ( 348 print "% 6d % 9d % 7d % 6d % 7d %s.. %s.. %s.." % (
349 i, e[0], e[1], e[2], e[3], 349 i, e[0], e[1], e[2], e[3],
350 hg.hex(e[4][:5]), hg.hex(e[5][:5]), hg.hex(e[6][:5])) 350 hg.hex(e[4][:5]), hg.hex(e[5][:5]), hg.hex(e[6][:5]))
351 351
352 elif cmd == "debugindexdot":
353 if ".hg" not in args[0]:
354 args[0] = ".hg/data/" + repo.file(args[0]).encodepath(args[0]) + "i"
355
356 r = hg.revlog(open, args[0], "")
357 print "digraph G {"
358 for i in range(r.count()):
359 e = r.index[i]
360 print "\t%d -> %d" % (r.rev(e[4]), i)
361 if e[5] != hg.nullid:
362 print "\t%d -> %d" % (r.rev(e[5]), i)
363 print "}"
364
352 elif cmd == "merge": 365 elif cmd == "merge":
353 if args: 366 if args:
354 other = hg.repository(ui, args[0]) 367 other = hg.repository(ui, args[0])
355 ui.status("requesting changegroup\n") 368 ui.status("requesting changegroup\n")
356 cg = repo.getchangegroup(other) 369 cg = repo.getchangegroup(other)