Show More
@@ -954,7 +954,10 b' def debugstate(ui, repo, **opts):' | |||
|
954 | 954 | datesort = opts.get('datesort') |
|
955 | 955 | |
|
956 | 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 | 961 | else: |
|
959 | 962 | keyfunc = None # sort by filename |
|
960 | 963 | entries = list(pycompat.iteritems(repo.dirstate)) |
@@ -962,20 +965,23 b' def debugstate(ui, repo, **opts):' | |||
|
962 | 965 | entries.extend(repo.dirstate.directories()) |
|
963 | 966 | entries.sort(key=keyfunc) |
|
964 | 967 | for file_, ent in entries: |
|
965 |
if ent |
|
|
968 | if ent.v1_mtime() == -1: | |
|
966 | 969 | timestr = b'unset ' |
|
967 | 970 | elif nodates: |
|
968 | 971 | timestr = b'set ' |
|
969 | 972 | else: |
|
970 | 973 | timestr = time.strftime( |
|
971 |
"%Y-%m-%d %H:%M:%S ", time.localtime(ent |
|
|
974 | "%Y-%m-%d %H:%M:%S ", time.localtime(ent.v1_mtime()) | |
|
972 | 975 | ) |
|
973 | 976 | timestr = encoding.strtolocal(timestr) |
|
974 |
if ent |
|
|
977 | if ent.mode & 0o20000: | |
|
975 | 978 | mode = b'lnk' |
|
976 | 979 | else: |
|
977 |
mode = b'%3o' % (ent |
|
|
978 | ui.write(b"%c %s %10d %s%s\n" % (ent[0], mode, ent[2], timestr, file_)) | |
|
980 | mode = b'%3o' % (ent.v1_mode() & 0o777 & ~util.umask) | |
|
981 | ui.write( | |
|
982 | b"%c %s %10d %s%s\n" | |
|
983 | % (ent.v1_state(), mode, ent.v1_size(), timestr, file_) | |
|
984 | ) | |
|
979 | 985 | for f in repo.dirstate.copies(): |
|
980 | 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