hgext/remotefilelog/shallowstore.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 14 Apr 2021 15:56:21 +0200
changeset 46920 7a9b74e98240
parent 43076 2372284d9457
child 48875 6000f5b25c9b
permissions -rw-r--r--
test-lfs: avoid a bashism when spawning the server For zsh, this &> call is read as "& >", this spin the process without redirection. As a result the server grab stdout, which does not get closed at the end of the test. As a result `run-tests.py` hang there forever, waiting for the the stream for be close. (which is probably as issue on its own). Differential Revision: https://phab.mercurial-scm.org/D10396

# shallowstore.py - shallow store for interacting with shallow repos
#
# Copyright 2013 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import


def wrapstore(store):
    class shallowstore(store.__class__):
        def __contains__(self, path):
            # Assume it exists
            return True

    store.__class__ = shallowstore

    return store