hgext/remotefilelog/shallowstore.py
author Kyle Lippincott <spectral@google.com>
Thu, 31 Jan 2019 14:29:24 -0800
changeset 41573 78b270a55dc6
parent 40545 3a333a582d7b
child 43076 2372284d9457
permissions -rw-r--r--
diff: when looking for diff configs, support a configurable prefix In a future commit, I want to make it possible to have the diff options pulled from (as an example) `commands.commit.interactive.ignorews`; previously we only supported this for customizable sections (so this would have needed a `commit-interactive` section and been named `commit-interactive.ignorews`, which felt a bit weird. Differential Revision: https://phab.mercurial-scm.org/D5833

# 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