Show More
@@ -1340,11 +1340,15 b' def debugsetparents(ui, repo, rev1, rev2' | |||||
1340 | finally: |
|
1340 | finally: | |
1341 | wlock.release() |
|
1341 | wlock.release() | |
1342 |
|
1342 | |||
1343 | def debugstate(ui, repo, nodates=None): |
|
1343 | def debugstate(ui, repo, nodates=None, datesort=None): | |
1344 | """show the contents of the current dirstate""" |
|
1344 | """show the contents of the current dirstate""" | |
1345 | timestr = "" |
|
1345 | timestr = "" | |
1346 | showdate = not nodates |
|
1346 | showdate = not nodates | |
1347 | for file_, ent in sorted(repo.dirstate._map.iteritems()): |
|
1347 | if datesort: | |
|
1348 | keyfunc = lambda x: (x[1][3], x[0]) # sort by mtime, then by filename | |||
|
1349 | else: | |||
|
1350 | keyfunc = None # sort by filename | |||
|
1351 | for file_, ent in sorted(repo.dirstate._map.iteritems(), key=keyfunc): | |||
1348 | if showdate: |
|
1352 | if showdate: | |
1349 | if ent[3] == -1: |
|
1353 | if ent[3] == -1: | |
1350 | # Pad or slice to locale representation |
|
1354 | # Pad or slice to locale representation | |
@@ -4512,7 +4516,8 b' table = {' | |||||
4512 | (debugsetparents, [], _('REV1 [REV2]')), |
|
4516 | (debugsetparents, [], _('REV1 [REV2]')), | |
4513 | "debugstate": |
|
4517 | "debugstate": | |
4514 | (debugstate, |
|
4518 | (debugstate, | |
4515 |
[('', 'nodates', None, _('do not display the saved mtime')) |
|
4519 | [('', 'nodates', None, _('do not display the saved mtime')), | |
|
4520 | ('', 'datesort', None, _('sort by saved mtime'))], | |||
4516 | _('[OPTION]...')), |
|
4521 | _('[OPTION]...')), | |
4517 | "debugsub": |
|
4522 | "debugsub": | |
4518 | (debugsub, |
|
4523 | (debugsub, |
@@ -231,7 +231,7 b' Show all commands + options' | |||||
231 | debugrename: rev |
|
231 | debugrename: rev | |
232 | debugrevspec: |
|
232 | debugrevspec: | |
233 | debugsetparents: |
|
233 | debugsetparents: | |
234 | debugstate: nodates |
|
234 | debugstate: nodates, datesort | |
235 | debugsub: rev |
|
235 | debugsub: rev | |
236 | debugwalk: include, exclude |
|
236 | debugwalk: include, exclude | |
237 | debugwireargs: three, four, ssh, remotecmd, insecure |
|
237 | debugwireargs: three, four, ssh, remotecmd, insecure |
General Comments 0
You need to be logged in to leave comments.
Login now