old_contents: #!/usr/bin/env python2
  
  import anydbm
  import marshal
  import sys
  
  
  def usage():
    sys.stderr.write("Usage: %s DB-FILE\n\n" % sys.argv[0])
    sys.stderr.write("Dump .db database files created by cvs2svn (for\n")
    sys.stderr.write("debugging purposes, generally).\n")
    sys.exit(1)
  
  
  def main():
    argc = len(sys.argv)
    if argc < 2:
      usage()
    db_file = anydbm.open(sys.argv[1], 'r')
    keys = db_file.keys()
    keys.sort()
    for key in keys:
      value = marshal.loads(db_file[key])
      print 'KEY: ' + key
      print 'VAL: ' + str(value)
      print ''
  
  
  if __name__ == "__main__":
    main()
  
new_contents: #!/usr/bin/env python2
  
  import anydbm
  import marshal
  import sys
  import os.path
  
  
  def usage():
    cmd = sys.argv[0]
    sys.stderr.write("Usage: %s DBFILE [...]\n\n" % os.path.basename(cmd))
    sys.stderr.write("Dump .db database files created by cvs2svn.\n")
    sys.exit(1)
  
  
  def main():
    argc = len(sys.argv)
    if argc < 2:
      usage()
    for db_file in sys.argv[1:]:
      print '*** ' + db_file + ' ***'
      print ''
      db_file = anydbm.open(sys.argv[1], 'r')
      keys = db_file.keys()
      keys.sort()
      longest_len = 0
      for key in keys:
        this_len = len(key)
        if this_len > longest_len:
          longest_len = this_len
      for key in keys:
        this_len = len(key)
        value = str(marshal.loads(db_file[key]))
        print ' ' * (longest_len - this_len) + key + ' : ' + value
      print ''
  
  if __name__ == "__main__":
    main()
  
subject: Improve the dump-db.py cvs2svn debugging tool.