Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 50907:1270677d740b
terse-status: use `sysstr` to specify attributes to set
We use unicode string to specify attribute and we add a explicit char for the
other usage.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 30 Aug 2023 13:01:10 +0200 |
parents | 13ad1b2ad3b4 |
children | d718eddf01d9 |
comparison
equal
deleted
inserted
replaced
50906:35885dbdc927 | 50907:1270677d740b |
---|---|
811 raise error.InputError(_(b"'%s' not recognized") % s) | 811 raise error.InputError(_(b"'%s' not recognized") % s) |
812 | 812 |
813 # creating a dirnode object for the root of the repo | 813 # creating a dirnode object for the root of the repo |
814 rootobj = dirnode(b'') | 814 rootobj = dirnode(b'') |
815 pstatus = ( | 815 pstatus = ( |
816 b'modified', | 816 ('modified', b'm'), |
817 b'added', | 817 ('added', b'a'), |
818 b'deleted', | 818 ('deleted', b'd'), |
819 b'clean', | 819 ('clean', b'c'), |
820 b'unknown', | 820 ('unknown', b'u'), |
821 b'ignored', | 821 ('ignored', b'i'), |
822 b'removed', | 822 ('removed', b'r'), |
823 ) | 823 ) |
824 | 824 |
825 tersedict = {} | 825 tersedict = {} |
826 for attrname in pstatus: | 826 for attrname, statuschar in pstatus: |
827 statuschar = attrname[0:1] | |
828 for f in getattr(statuslist, attrname): | 827 for f in getattr(statuslist, attrname): |
829 rootobj.addfile(f, statuschar) | 828 rootobj.addfile(f, statuschar) |
830 tersedict[statuschar] = [] | 829 tersedict[statuschar] = [] |
831 | 830 |
832 # we won't be tersing the root dir, so add files in it | 831 # we won't be tersing the root dir, so add files in it |