def pretty_format_tree_entry(name, mode, hexsha, encoding='utf-8'):
 if (mode & stat.S_IFDIR):
  kind = 'tree'
 else:
  kind = 'blob'
 return ('%04o %s %s DCTB %s\n' % (mode, kind, hexsha.decode('ascii'), name.decode(encoding, 'replace')))

def pretty_format_tree_entry ( name , mode , hexsha , encoding = 'utf-8' ) : if ( mode & stat . S_IFDIR ) : kind = 'tree' else : kind = 'blob' return ( '%04o %s %s DCTB %s\n' % ( mode , kind , hexsha . decode ( 'ascii' ) , name . decode ( encoding , 'replace' ) ) )
pretty format tree entry .