Mercurial > hg
annotate .clang-format @ 43847:49fa0b31ee1d
cext-revlog: fixed __delitem__ for uninitialized nodetree
This is a bug in a code path that's seldom used, because in practice
(at least in the whole test suite), calls to `del index[i:j]` currently
just don't happen before the nodetree has been initialized.
However, in our current work to replace the nodetree by a Rust implementation,
this is of course systematic.
In `index_slice_del()`, if the slice start is smaller than `self->length`,
the whole of `self->added` has to be cleared.
Before this change, the clearing was done only by the call to
`index_invalidate_added(self, 0)`, that happens only for initialized
nodetrees. Hence the removal was effective only from `start` to `self->length`.
The consequence is index corruption, with bogus results in subsequent calls,
and in particular errors such as `ValueError("parent out of range")`, due to
the fact that parents of entries in `self->added` are now just invalid.
This is detected by the rebase tests, under conditions that the nodetree
of revlog.c is never initialized. The provided specific test is more direct.
Differential Revision: https://phab.mercurial-scm.org/D7603
author | Georges Racinet <georges.racinet@octobus.net> |
---|---|
date | Thu, 05 Dec 2019 20:41:23 +0100 |
parents | d0a3fa849cb8 |
children |
rev | line source |
---|---|
34798
e33381d95930
clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
1 BasedOnStyle: LLVM |
e33381d95930
clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
2 IndentWidth: 8 |
e33381d95930
clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
3 UseTab: ForIndentation |
e33381d95930
clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
4 BreakBeforeBraces: Linux |
e33381d95930
clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
5 AllowShortIfStatementsOnASingleLine: false |
e33381d95930
clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
6 IndentCaseLabels: false |
e33381d95930
clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
7 AllowShortBlocksOnASingleLine: false |
e33381d95930
clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff
changeset
|
8 AllowShortFunctionsOnASingleLine: false |
36224
d0a3fa849cb8
formatting: enforce system headers before local headers
Augie Fackler <augie@google.com>
parents:
34798
diff
changeset
|
9 IncludeCategories: |
d0a3fa849cb8
formatting: enforce system headers before local headers
Augie Fackler <augie@google.com>
parents:
34798
diff
changeset
|
10 - Regex: '^<' |
d0a3fa849cb8
formatting: enforce system headers before local headers
Augie Fackler <augie@google.com>
parents:
34798
diff
changeset
|
11 Priority: 1 |
d0a3fa849cb8
formatting: enforce system headers before local headers
Augie Fackler <augie@google.com>
parents:
34798
diff
changeset
|
12 - Regex: '^"' |
d0a3fa849cb8
formatting: enforce system headers before local headers
Augie Fackler <augie@google.com>
parents:
34798
diff
changeset
|
13 Priority: 2 |