##// END OF EJS Templates
dirstate-item: use the v1_serialization method in debugstate...
marmoute -
r48368:85ce6ed5 default
parent child Browse files
Show More
@@ -954,7 +954,10 b' def debugstate(ui, repo, **opts):'
954 datesort = opts.get('datesort')
954 datesort = opts.get('datesort')
955
955
956 if datesort:
956 if datesort:
957 keyfunc = lambda x: (x[1][3], x[0]) # sort by mtime, then by filename
957 keyfunc = lambda x: (
958 x[1].v1_mtime(),
959 x[0],
960 ) # sort by mtime, then by filename
958 else:
961 else:
959 keyfunc = None # sort by filename
962 keyfunc = None # sort by filename
960 entries = list(pycompat.iteritems(repo.dirstate))
963 entries = list(pycompat.iteritems(repo.dirstate))
@@ -962,20 +965,23 b' def debugstate(ui, repo, **opts):'
962 entries.extend(repo.dirstate.directories())
965 entries.extend(repo.dirstate.directories())
963 entries.sort(key=keyfunc)
966 entries.sort(key=keyfunc)
964 for file_, ent in entries:
967 for file_, ent in entries:
965 if ent[3] == -1:
968 if ent.v1_mtime() == -1:
966 timestr = b'unset '
969 timestr = b'unset '
967 elif nodates:
970 elif nodates:
968 timestr = b'set '
971 timestr = b'set '
969 else:
972 else:
970 timestr = time.strftime(
973 timestr = time.strftime(
971 "%Y-%m-%d %H:%M:%S ", time.localtime(ent[3])
974 "%Y-%m-%d %H:%M:%S ", time.localtime(ent.v1_mtime())
972 )
975 )
973 timestr = encoding.strtolocal(timestr)
976 timestr = encoding.strtolocal(timestr)
974 if ent[1] & 0o20000:
977 if ent.mode & 0o20000:
975 mode = b'lnk'
978 mode = b'lnk'
976 else:
979 else:
977 mode = b'%3o' % (ent[1] & 0o777 & ~util.umask)
980 mode = b'%3o' % (ent.v1_mode() & 0o777 & ~util.umask)
978 ui.write(b"%c %s %10d %s%s\n" % (ent[0], mode, ent[2], timestr, file_))
981 ui.write(
982 b"%c %s %10d %s%s\n"
983 % (ent.v1_state(), mode, ent.v1_size(), timestr, file_)
984 )
979 for f in repo.dirstate.copies():
985 for f in repo.dirstate.copies():
980 ui.write(_(b"copy: %s -> %s\n") % (repo.dirstate.copied(f), f))
986 ui.write(_(b"copy: %s -> %s\n") % (repo.dirstate.copied(f), f))
981
987
General Comments 0
You need to be logged in to leave comments. Login now