comparison mercurial/commands.py @ 1090:1bca39b85615

Move opener to utils - move the opener code down to util - add docstring - change commands.py users to simply use file instead
author mpm@selenic.com
date Sat, 27 Aug 2005 14:31:41 -0700
parents 6f94688b81b6
children 0a02315976ff
comparison
equal deleted inserted replaced
1089:142b5d5ec9cc 1090:1bca39b85615
688 time.strftime("%x %X", 688 time.strftime("%x %X",
689 time.localtime(dc[file_][3])), file_)) 689 time.localtime(dc[file_][3])), file_))
690 690
691 def debugdata(ui, file_, rev): 691 def debugdata(ui, file_, rev):
692 """dump the contents of an data file revision""" 692 """dump the contents of an data file revision"""
693 r = hg.revlog(hg.opener(""), file_[:-2] + ".i", file_) 693 r = hg.revlog(file, file_[:-2] + ".i", file_)
694 ui.write(r.revision(r.lookup(rev))) 694 ui.write(r.revision(r.lookup(rev)))
695 695
696 def debugindex(ui, file_): 696 def debugindex(ui, file_):
697 """dump the contents of an index file""" 697 """dump the contents of an index file"""
698 r = hg.revlog(hg.opener(""), file_, "") 698 r = hg.revlog(file, file_, "")
699 ui.write(" rev offset length base linkrev" + 699 ui.write(" rev offset length base linkrev" +
700 " nodeid p1 p2\n") 700 " nodeid p1 p2\n")
701 for i in range(r.count()): 701 for i in range(r.count()):
702 e = r.index[i] 702 e = r.index[i]
703 ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % ( 703 ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % (
704 i, e[0], e[1], e[2], e[3], 704 i, e[0], e[1], e[2], e[3],
705 hg.short(e[6]), hg.short(e[4]), hg.short(e[5]))) 705 hg.short(e[6]), hg.short(e[4]), hg.short(e[5])))
706 706
707 def debugindexdot(ui, file_): 707 def debugindexdot(ui, file_):
708 """dump an index DAG as a .dot file""" 708 """dump an index DAG as a .dot file"""
709 r = hg.revlog(hg.opener(""), file_, "") 709 r = hg.revlog(file, file_, "")
710 ui.write("digraph G {\n") 710 ui.write("digraph G {\n")
711 for i in range(r.count()): 711 for i in range(r.count()):
712 e = r.index[i] 712 e = r.index[i]
713 ui.write("\t%d -> %d\n" % (r.rev(e[4]), i)) 713 ui.write("\t%d -> %d\n" % (r.rev(e[4]), i))
714 if e[5] != hg.nullid: 714 if e[5] != hg.nullid: