Mercurial > hg
view tests/readlink.py @ 48723:27fe84a8dd60
obsolete: always return frozensets from obsolete.getrevs()
getrevs function already returns an empty frozenset when there is no obsstore,
but let's make sure to return a frozenset in any case. This makes it possible
to use the result of this function as a dict key or provide it to hash()
built-in function without any conversions.
Differential Revision: https://phab.mercurial-scm.org/D12156
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Mon, 07 Feb 2022 12:25:46 +0300 |
parents | c102b704edb5 |
children | 6000f5b25c9b |
line wrap: on
line source
#!/usr/bin/env python3 from __future__ import absolute_import, print_function import errno import os import sys for f in sys.argv[1:]: try: print(f, '->', os.readlink(f)) except OSError as err: if err.errno != errno.EINVAL: raise print(f, '->', f, 'not a symlink') sys.exit(0)