tests/readlink.py
author Pulkit Goyal <pulkit@yandex-team.ru>
Tue, 23 Oct 2018 14:26:17 +0300
changeset 40435 d362a41ee5dd
parent 29485 6a98f9408a50
child 45830 c102b704edb5
permissions -rwxr-xr-x
tests: show that adding an already included path still calls narrow_widen() This patch adds tests demonstrating that we still go to the server in non-ellipses widening when we have that path already on the client and there is nothing new to download. The next patch will try to make client side logic smart and not go to the server if we don't need to download anything. Differential Revision: https://phab.mercurial-scm.org/D5182

#!/usr/bin/env python

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)