darcs

Issue 1925 darcs wants to delete files (probably added by darcs v1)

Title darcs wants to delete files (probably added by darcs v1)
Priority bug Status given-up
Milestone 2.12.0 Resolved in
Superseder Nosy List dmitry.kurochkin, kowey, mornfall
Assigned To
Topics Regression

Created on 2010-08-18.20:13:58 by igloo, last changed 2017-07-31.01:55:44 by gh.

Files
File name Uploaded Type Edit Remove
containers.tar.gz igloo, 2010-08-18.20:13:56 application/gzip
Messages
msg12223 (view) Author: igloo Date: 2010-08-18.20:13:56
darcs 2 wants to delete files which were probably added by darcs 1.
darcs 2's check complains about indexes.

$ darcs --version
2.4.3 (release)
$ tar -zxf containers.tar.gz 
$ cd containers 
$ cat _darcs/patches/pending
{
}
$ darcs what 
hunk ./tests/datamap002.hs 1
-
--- In 6.12 this failed
-
-module Main (main) where
-
-import Data.Map
-
-main :: IO ()
-main = print $ valid $ deleteMin $ deleteMin
-     $ fromList [ (i, ()) | i <- [0,2,5,1,6,4,8,9,7,11,10,3] ]
-
rmfile ./tests/datamap002.hs
hunk ./tests/datamap002.stdout 1
-True
rmfile ./tests/datamap002.stdout
$ ls -l tests/datamap002.hs tests/datamap002.stdout
-rw-r--r-- 1 ian ian 191 Aug 15 14:18 tests/datamap002.hs
-rw-r--r-- 1 ian ian   5 Aug 15 14:18 tests/datamap002.stdout
$ darcs show repo
          Type: darcs
        Format: darcs-1.0
          Root: /tmp/ian/containers
      Pristine: PlainPristine "_darcs/pristine"
         Cache: thisrepo:/tmp/ian/containers, cache:/home/ian/.darcs/cache
boringfile Pref: .darcs-boring
Default Remote: http://darcs.haskell.org/packages/containers
   Num Patches: 1866
$ darcs check
The repository is consistent!                                          
        
Missing items in index!
  tests/datamap002.hs
  tests/datamap002.stdout

Hash mismatch(es)!
tests/datamap002.stdout
    index: 
  working: a9ac0c3ac83c40e1b4c3416066d63d324ee9f8c144641dfeed72d140b6557245
tests/datamap002.hs
    index: 
  working: f4b52f5b628a93b09826a4dd9d586e42b4132f270ad93c8c8d8682c707f1081c
tests
    index: 62332fac77135ffe00b416c24fc675cd752a348ef14a9d5b0c8ad74a3b782aff
  working: 2847e9c1a2c9aefe669d7d9f11a1fe96bb00bd95e3b09e66fc043db6d9694c14

Bad index.
$
Attachments
msg12230 (view) Author: mornfall Date: 2010-08-19.09:46:38
Ian Lynagh <bugs@darcs.net> writes:

> darcs 2 wants to delete files which were probably added by darcs 1.
> darcs 2's check complains about indexes.
Ok, I see now.

You need to touch _darcs/index_invalid every time you use darcs 1 to
edit the repository if you also want to use darcs >= 2.3 on it.

This mechanism may change in the future to something more resilient, but
that will only work with hashed repositories anyway (since there is no
way to track contents of plain pristine). In other words, a more robust
index handling is conditional on deprecation of old-fashioned.

So the only real option to fix this is to add extra code to handle
working directories of old-fashioned differently than those of
hashed. Volunteers needed, assuming that old-fashioned is not
deprecated.

Yours,
   Petr.
msg12231 (view) Author: kowey Date: 2010-08-19.10:23:58
On Thu, Aug 19, 2010 at 09:46:39 +0000, Petr Ročkai wrote:
> So the only real option to fix this is to add extra code to handle
> working directories of old-fashioned differently than those of
> hashed. Volunteers needed, assuming that old-fashioned is not
> deprecated.

Forgive me if the answer is too obvious, but how about not using an
index for old-fashioned repositories, just behaving more like darcs 1
would?

Thanks,

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, try +44 (0)1273 64 2905 or
xmpp:kowey@jabber.fr (Jabber or Google Talk only)
msg12232 (view) Author: mornfall Date: 2010-08-19.10:45:09
Eric Kow <kowey@darcs.net> writes:

> On Thu, Aug 19, 2010 at 09:46:39 +0000, Petr Ročkai wrote:
>> So the only real option to fix this is to add extra code to handle
>> working directories of old-fashioned differently than those of
>> hashed. Volunteers needed, assuming that old-fashioned is not
>> deprecated.
>
> Forgive me if the answer is too obvious, but how about not using an
> index for old-fashioned repositories, just behaving more like darcs 1
> would?
That's what I meant with introducing a separate working copy handling
code for oldfashioned.

Yours,
   Petr.
msg12233 (view) Author: kowey Date: 2010-08-19.12:20:00
OK now all we need is a minimal case for the regression suite and of 
course, the implementation.

I'd call this a regression from Darcs 2.2 and suggest it be fixed for 
the next major release after 2.5.

BTS training: you want a fairly stable and consistent workflow for bugs 
so that you don't have to think too much about it.  Typically, your 
treadmill consists of get a test case (need-action), diagnose the issue 
(need-action), and then hack (need-implementation).  If people work "out 
of order", that's perfectly fine; whatever gets the job done, but you 
can still use the treadmill to track things.
msg14762 (view) Author: markstos Date: 2011-10-13.13:09:45
It's not a regression since 2.5, so bumping to 2.10.
History
Date User Action Args
2010-08-18 20:13:58igloocreate
2010-08-19 09:46:39mornfallsetmessages: + msg12230
2010-08-19 10:23:59koweysetnosy: + mornfall
messages: + msg12231
2010-08-19 10:45:10mornfallsetnosy: + kowey
messages: + msg12232
2010-08-19 12:20:01koweysetpriority: bug
status: unknown -> needs-reproduction
topic: + Regression
messages: + msg12233
milestone: 2.8.0
2011-10-13 13:09:45markstossetmessages: + msg14762
milestone: 2.8.0 -> 2.10.0
2015-04-18 17:39:44ghsetmilestone: 2.10.0 -> 2.12.0
2017-07-31 01:55:44ghsetstatus: needs-reproduction -> given-up