comparison cutils/treesum.py @ 344:0a58948df713

Move the computation of the special tag string marker for special files into a property
author Franz Glasner <fzglas.hg@dom66.de>
date Tue, 01 Apr 2025 12:45:56 +0200
parents 728ad9c639f2
children d47965f97abb
comparison
equal deleted inserted replaced
343:b3931b511ed0 344:0a58948df713
911 if self._utf8_mode: 911 if self._utf8_mode:
912 opath = walk.WalkDirEntry.alt_u8(opath) 912 opath = walk.WalkDirEntry.alt_u8(opath)
913 else: 913 else:
914 opath = walk.WalkDirEntry.alt_fs(opath) 914 opath = walk.WalkDirEntry.alt_fs(opath)
915 if fso.is_special: 915 if fso.is_special:
916 # Determine the tag character 916 special_tag = util.b(fso.special_tag)
917 if fso.is_chr:
918 special_tag = b':'
919 elif fso.is_blk:
920 special_tag = b';'
921 elif fso.is_fifo:
922 special_tag = b'|'
923 elif fso.is_socket:
924 special_tag = b'='
925 elif fso.is_door:
926 special_tag = b'>'
927 elif fso.is_whiteout:
928 special_tag = b'%'
929 elif fso.is_eventport:
930 special_tag = b'+'
931 else:
932 assert False, "unknown special filesystem object"
933 assert fso.stat is not None # because .is_special is True 917 assert fso.stat is not None # because .is_special is True
934 if fso.is_symlink and not self._follow_symlinks.file: 918 if fso.is_symlink and not self._follow_symlinks.file:
935 linktgt = walk.WalkDirEntry.from_readlink( 919 linktgt = walk.WalkDirEntry.from_readlink(
936 os.readlink(fso.path)) 920 os.readlink(fso.path))
937 linkdgst = self._algorithm[0]() 921 linkdgst = self._algorithm[0]()