mercurial/debugcommands.py
changeset 47683 284a20269a97
parent 47682 78f7f0d490ee
child 47815 b30a53ffbf9b
equal deleted inserted replaced
47682:78f7f0d490ee 47683:284a20269a97
   940             None,
   940             None,
   941             _(b'do not display the saved mtime (DEPRECATED)'),
   941             _(b'do not display the saved mtime (DEPRECATED)'),
   942         ),
   942         ),
   943         (b'', b'dates', True, _(b'display the saved mtime')),
   943         (b'', b'dates', True, _(b'display the saved mtime')),
   944         (b'', b'datesort', None, _(b'sort by saved mtime')),
   944         (b'', b'datesort', None, _(b'sort by saved mtime')),
   945         (b'', b'dirs', False, _(b'display directories')),
   945         (
       
   946             b'',
       
   947             b'all',
       
   948             False,
       
   949             _(b'display dirstate-v2 tree nodes that would not exist in v1'),
       
   950         ),
   946     ],
   951     ],
   947     _(b'[OPTION]...'),
   952     _(b'[OPTION]...'),
   948 )
   953 )
   949 def debugstate(ui, repo, **opts):
   954 def debugstate(ui, repo, **opts):
   950     """show the contents of the current dirstate"""
   955     """show the contents of the current dirstate"""
   959             x[1].v1_mtime(),
   964             x[1].v1_mtime(),
   960             x[0],
   965             x[0],
   961         )  # sort by mtime, then by filename
   966         )  # sort by mtime, then by filename
   962     else:
   967     else:
   963         keyfunc = None  # sort by filename
   968         keyfunc = None  # sort by filename
   964     entries = list(pycompat.iteritems(repo.dirstate))
   969     if opts['all']:
   965     if opts['dirs']:
   970         entries = list(repo.dirstate._map.debug_iter())
   966         entries.extend(repo.dirstate.directories())
   971     else:
       
   972         entries = list(pycompat.iteritems(repo.dirstate))
   967     entries.sort(key=keyfunc)
   973     entries.sort(key=keyfunc)
   968     for file_, ent in entries:
   974     for file_, ent in entries:
   969         if ent.v1_mtime() == -1:
   975         if ent.v1_mtime() == -1:
   970             timestr = b'unset               '
   976             timestr = b'unset               '
   971         elif nodates:
   977         elif nodates: