annotate mercurial/cext/mpatch.pyi @ 46335:25be21ec6c65

share: rework config options to be much clearer and easier Recently I implemented various boolean configs which control how to behave when there is a share-safe mismatch between source and share repository. Mismatch means that source supports share-safe where as share does not or vice versa. However, while discussion and documentation we realized that it's too complicated and there are some combinations of values which makes no sense. We decided to introduce a config option with 4 possible values which makes controlling and understanding things easier. The config option `share.safe-mismatch.source-{not-}safe` can have following 4 values: * abort (default): error out if there is mismatch * allow: allow to work with respecting share source configuration * {up|down}grade-abort: try to {up|down}grade, if it fails, abort * {up|down}grade-allow: try to {up|down}grade, if it fails, continue in allow mode I am not sure if I can explain 3 config options which I deleted right now in just 5 lines which is a sign of how complex they became. No test changes demonstrate that functionality is same, only names have changed. Differential Revision: https://phab.mercurial-scm.org/D9785
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 18 Jan 2021 21:37:20 +0530
parents 8dca9051a859
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
46038
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
1 from typing import (
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
2 List,
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
3 )
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
4
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
5 version: int
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
6
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
7 class mpatchError(Exception): ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
8
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
9 def patches(text: bytes, bins: List[bytes]) -> bytes: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
10 def patchedsize(orig: int, data: bytes) -> int: ...