hgext/remotefilelog/shallowstore.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Tue, 05 Jul 2022 17:53:26 +0200
branchstable
changeset 49376 7fe86498e84f
parent 48966 6000f5b25c9b
permissions -rw-r--r--
repo-upgrade: avoid a crash when multiple optimisation are specified In Python 3, the type are no longer comparable and this expose the error.

# 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.


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

    store.__class__ = shallowstore

    return store