terse-status: use `sysstr` to specify attributes to set
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 30 Aug 2023 13:01:10 +0200
changeset 50910 1270677d740b
parent 50909 35885dbdc927
child 50911 1339158a8a40
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.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Wed Aug 30 00:50:28 2023 +0200
+++ b/mercurial/cmdutil.py	Wed Aug 30 13:01:10 2023 +0200
@@ -813,18 +813,17 @@
     # creating a dirnode object for the root of the repo
     rootobj = dirnode(b'')
     pstatus = (
-        b'modified',
-        b'added',
-        b'deleted',
-        b'clean',
-        b'unknown',
-        b'ignored',
-        b'removed',
+        ('modified', b'm'),
+        ('added', b'a'),
+        ('deleted', b'd'),
+        ('clean', b'c'),
+        ('unknown', b'u'),
+        ('ignored', b'i'),
+        ('removed', b'r'),
     )
 
     tersedict = {}
-    for attrname in pstatus:
-        statuschar = attrname[0:1]
+    for attrname, statuschar in pstatus:
         for f in getattr(statuslist, attrname):
             rootobj.addfile(f, statuschar)
         tersedict[statuschar] = []