comparison mercurial/commands.py @ 1313:1cc7c0cbc30b

Fix traceback during invalid rev identifier for debugdata
author Anupam Kapoor<anupam.kapoor@gmail.com>
date Thu, 22 Sep 2005 09:42:15 -0700
parents c9cf171f30dd
children d37a46859acd
comparison
equal deleted inserted replaced
1312:c9cf171f30dd 1313:1cc7c0cbc30b
851 ui.write("copy: %s -> %s\n" % (repo.dirstate.copies[f], f)) 851 ui.write("copy: %s -> %s\n" % (repo.dirstate.copies[f], f))
852 852
853 def debugdata(ui, file_, rev): 853 def debugdata(ui, file_, rev):
854 """dump the contents of an data file revision""" 854 """dump the contents of an data file revision"""
855 r = revlog.revlog(file, file_[:-2] + ".i", file_) 855 r = revlog.revlog(file, file_[:-2] + ".i", file_)
856 ui.write(r.revision(r.lookup(rev))) 856 try:
857 ui.write(r.revision(r.lookup(rev)))
858 except KeyError:
859 raise util.Abort('invalid revision identifier %s', rev)
857 860
858 def debugindex(ui, file_): 861 def debugindex(ui, file_):
859 """dump the contents of an index file""" 862 """dump the contents of an index file"""
860 r = revlog.revlog(file, file_, "") 863 r = revlog.revlog(file, file_, "")
861 ui.write(" rev offset length base linkrev" + 864 ui.write(" rev offset length base linkrev" +