Mercurial > hg
view mercurial/mpatch.h @ 35778:128dd940bedc
repair: invalidate volatile sets after stripping
Matt Harbison reported that some tests were broken on Windows after
1a09dad8b85a (evolution: report new unstable changesets,
2018-01-14). The failures were exactly as seen in this patch. The
failures actually seemed correct, which made me wonder why they didn't
fail the same way on Linux. It turned out to be a cache invalidation
problem.
The new orphan mentioned in the test case actually does get created
when we're re-applying the temporary bundle that's created while
stripping. However, without the invalidation, it appears that there
was already an orphan before applying the temporary bundle.
The warnings about unknown working parent appear because the
aformentioned changeset means that we're now accessing the dirstate
while it's invalid.
We may want to suppress these messages that happen in the intermediate
strip state, but they're technically correct (although confusing to
the user), so I think just fixing the cache invalidation is fine for
now.
I haven't figured out why the caches seemed to get correctly
invalidated on Windows.
Differential Revision: https://phab.mercurial-scm.org/D1933
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sat, 20 Jan 2018 23:21:59 -0800 |
parents | 761355833867 |
children | d86908050375 |
line wrap: on
line source
#ifndef _HG_MPATCH_H_ #define _HG_MPATCH_H_ #define MPATCH_ERR_NO_MEM -3 #define MPATCH_ERR_CANNOT_BE_DECODED -2 #define MPATCH_ERR_INVALID_PATCH -1 struct mpatch_frag { int start, end, len; const char *data; }; struct mpatch_flist { struct mpatch_frag *base, *head, *tail; }; int mpatch_decode(const char *bin, ssize_t len, struct mpatch_flist **res); ssize_t mpatch_calcsize(ssize_t len, struct mpatch_flist *l); void mpatch_lfree(struct mpatch_flist *a); int mpatch_apply(char *buf, const char *orig, ssize_t len, struct mpatch_flist *l); struct mpatch_flist * mpatch_fold(void *bins, struct mpatch_flist *(*get_next_item)(void *, ssize_t), ssize_t start, ssize_t end); #endif