always update to the correct head of Mercurial repositories #4600
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When indexing a particular repository after a recent change, the incremental indexer run failed with:
Digging into the problem, the changeset that was added was not reflected in the file-system changes. The mirroring logs said:
Basically, the mirroring for the repo executed these commands:
What happened was that the update was done to some historical changeset instead of the
tip
so no files were actually updated (the output showing the0 files updated
). The incremental file detection using the changesets (history based reindex) rather than the file system traversal got the file list correctly however the time stamp was taken from the file system, hence the indexer failure.The historical changeset 53e7d284bbb4 was actually a head (visible in the output from
hg log --graph -b .
) likely created inadvertently and later removed (it is not in a fresh clone of the repository) however it was already pulled, causing a situation with 2 heads.hg log --rev 'head() and branch(".")'
shows two changesets - one correct one (5b82d16f6f44), one is the stub (53e7d284bbb4).This change fixes the problem by using the head with maximum index.