Mercurial > hg
view tests/test-ancestor.py.out @ 42193:14589f1989e9 stable
context: check file exists before getting data from _wrappedctx
overlayworkingctx class is used to do in-memory merging. The data() function of
that class has logic to look for data() in the wrappedctx if the file data in
cache is empty and if the file is dirty. This assumes that if a file is dirty
and cache has empty data for it, it will exists in the _wrappedctx.
However this assumption can be False in case when we are merging a file which is
empty in destination. In these cases, the backup file 'foo.orig' created by our
internal merge algorithms will be empty, however it won't be present in
_wrappedctx. This case will lead us to error like the one this patch is fixing.
Let's only fallback to getting data from wrappedctx if cache has 'None' as data.
Differential Revision: https://phab.mercurial-scm.org/D6308
author | Pulkit Goyal <pulkit@yandex-team.ru> |
---|---|
date | Wed, 24 Apr 2019 19:42:43 +0300 |
parents | d097dd0afc19 |
children |
line wrap: on
line source
% removeancestorsfrom(), example 1 remaining (sorted): [5, 6, 8, 9] % removeancestorsfrom(), example 2 remaining (sorted): [11, 12, 13, 14] % removeancestorsfrom(), example 3 remaining (sorted): [3, 5] % missingancestors(), example 1 return [3, 7, 11] % missingancestors(), example 2 return [5, 10] % missingancestors(), example 3 return [3, 6, 9, 11] % removeancestorsfrom(), bigger graph Ok % lazy ancestor set for [], stoprev = 0, inclusive = False membership: [] iteration: [] % lazy ancestor set for [11, 13], stoprev = 0, inclusive = False membership: [7, 8, 3, 4, 1, 0] iteration: [8, 7, 4, 3, 2, 1, 0] % lazy ancestor set for [1, 3], stoprev = 0, inclusive = False membership: [1, 0] iteration: [1, 0] % lazy ancestor set for [11, 13], stoprev = 0, inclusive = True membership: [11, 13, 7, 8, 3, 4, 1, 0] iteration: [13, 11, 8, 7, 4, 3, 2, 1, 0] % lazy ancestor set for [11, 13], stoprev = 6, inclusive = False membership: [7, 8] iteration: [8, 7] % lazy ancestor set for [11, 13], stoprev = 6, inclusive = True membership: [11, 13, 7, 8] iteration: [13, 11, 8, 7] % lazy ancestor set for [11, 13], stoprev = 11, inclusive = True membership: [11, 13] iteration: [13, 11] % lazy ancestor set for [11, 13], stoprev = 12, inclusive = True membership: [13] iteration: [13] % lazy ancestor set for [10, 1], stoprev = 0, inclusive = True membership: [2, 10, 4, 5, 0, 1] iteration: [10, 5, 4, 2, 1, 0]