darcs

Issue 2425 broken repo when using darcs init shortly after copying files

Title broken repo when using darcs init shortly after copying files
Priority bug Status given-up
Milestone Resolved in 2.10.0
Superseder Nosy List bfrk
Assigned To
Topics

Created on 2014-12-09.14:35:39 by bfrk, last changed 2017-07-31.01:31:53 by gh.

Files
File name Uploaded Type Edit Remove
darcs-example.tar.gz bfrk, 2014-12-09.14:35:38 application/gzip
Messages
msg17885 (view) Author: bfrk Date: 2014-12-09.14:35:37
As part of a test suite for a program that calls darcs, a colleague of
mine discovered a problem in darcs-2.8.5. He created a small
reproducible test case, which I attached to the ticket. A script copies
files to some location and then calls 'darcs init' there and records
some patches. The result is a broken repo, 'darcs check' says:

The repository is consistent!
Hash mismatch(es)!
configure/RELEASE
    index: 7930e44ee9c71190a7f9b692bcde43d7205427f2dfcd53777f63e075e239ce37
  working: d68193939a0a71e5f394d050b0d91609142b3a4ac0d6aeb55455571394c9696a
configure
    index: 1130210237cf14a8681edf345f502476736cfdbb3b01a92e884c4a1fd7b2568b
  working: 11b5cd6c122c6251eb4d525fc0def7c32300b005e72e774903cdbad284925f6e

Bad index.

When you 'darcs get' the repo, the new repo will not contain the
problem. Also 'darcs repair' (in the original one) fixes it.

The attached tar ball contains everything needed to reproduce the
problem. The interesting things happen inside repos/mk-repos.sh. It
contains a commented-out line 

    #sleep 1

If the sleep is un-commented, the problem disappears.

I verified that this bug does not appear in the HEAD. It would be nice
if we could find out which patch fixed the problem and make a 2.8.6
release with this patch. This bug-fix release could then go into stable
distributions...
Attachments
msg17887 (view) Author: ganesh Date: 2014-12-09.17:08:18
In general scripts that call darcs repeatedly within the same second 
need to pass '--ignore-times' to avoid problems with the index. I'm not 
sure how we can document this more clearly, but it is sort of by-design 
because the file index is a nice optimisation for the common case.
History
Date User Action Args
2014-12-09 14:35:39bfrkcreate
2014-12-09 17:08:19ganeshsetmessages: + msg17887
2017-07-31 01:31:53ghsetstatus: unknown -> given-up