darcs

Issue 668 darcs2 repair fails where darcs 1 latest stable does not

Title darcs2 repair fails where darcs 1 latest stable does not
Priority bug Status duplicate
Milestone Resolved in
Superseder fix bug in bugs/pull.sh test, which now passes.
View: 662
Nosy List darcs-devel, dmitry.kurochkin, kowey, mail1, markstos, nicolairichter, thorkilnaur, tommy
Assigned To
Topics Darcs2, Regression

Created on 2008-02-09.11:53:03 by mail1, last changed 2009-08-27.13:54:59 by admin.

Files
File name Uploaded Type Edit Remove
unnamed mail1, 2008-02-09.11:53:01 text/html
Messages
msg3260 (view) Author: mail1 Date: 2008-02-09.11:53:01
Hi Devs,

being a new user, I wanted to support Darcs2 as much as possible, using it
on not-so-important directories.

I have a dir that stores some command shortcuts which I sync across PCs. I
ran into a failed push and tried to use darcs1 and darcs2 to repair it.

Darcs1 went through and deemed the repo OK, while darcs2 barfed. This is
what I get:

----------

P:\bin>darcs_2008-02-06.exe repair
Unapplicable patch:
Thu Feb 7 12:24:30 Romance Standard Time 2008  xxxx <mail@nxxxxxxxxx.de>
  * add_less_and_dcsv

darcs failed: Error applying hunk to file ./dcs.cmd

P:\bin>darcs2 cha -p dcsv -v

P:\bin>darcs_2008-02-06.exe cha -p dcsv -v
diffing dir...
Thu Feb 7 12:24:30 Romance Standard Time 2008 xxxx <mail@nixxxxxxxxxxx.de>
  * add_less_and_dcsv
  {
  addfile ./dcs-v.cmd
  hunk ./dcs-v.cmd 1
  +"c:\program files\darcs\darcs.exe" %1 -v %2 %3 %4 %5 %6[_^M_][_$_]
  hunk ./dcs.cmd 1
  -"c:\program files\darcs\darcs.exe" %1 %2 %3 %4 %5 %6[_^M_][_$_]
  -
  +@"c:\program files\darcs\darcs.exe" %1 %2 %3 %4 %5 %6
  addfile ./less.cmd
  hunk ./less.cmd 1
  +more %1 %2 %3 %4[_^M_][_$_]
  }

P:\bin>type dcs.cmd
@"c:\program files\darcs\darcs.exe" %1 %2 %3 %4 %5 %6
P:\bin>

----------

Looks like there is a hunk that wants to change the file to what it already
contains.

If you need any extra info, let me know!

  Nico
Attachments
msg3262 (view) Author: markstos Date: 2008-02-09.14:38:38
Thanks for the report, Nico.

I'm tentatively marking this as a dupe of issue662, which I reported just a
couple of days ago. In that case, Darcs2 fails with the same error message:

 darcs failed: Error applying hunk to file

Once that one is addressed, we can test to see if your case is the same, or a
variation.
msg3317 (view) Author: nicolairichter Date: 2008-02-11.16:22:57
Sure, that's fine. I also noticed after submission some other reports  
looked similar.
I've made a copy of the repo in case you'd need it later.

   Nico

On Sat, 09 Feb 2008 15:38:41 +0100, Mark Stosberg <bugs@darcs.net> wrote:

> Thanks for the report, Nico.
>
> I'm tentatively marking this as a dupe of issue662, which I reported  
> just a
> couple of days ago. In that case, Darcs2 fails with the same error  
> message:
>
>  darcs failed: Error applying hunk to file
>
> Once that one is addressed, we can test to see if your case is the same,  
> or a
> variation.
msg3319 (view) Author: droundy Date: 2008-02-11.16:34:31
On Mon, Feb 11, 2008 at 04:22:58PM -0000, Nicolai Richter wrote:
> Sure, that's fine. I also noticed after submission some other reports  
> looked similar.
> I've made a copy of the repo in case you'd need it later.

Could you put it online? (Or email a tarball of it, if it's small.)  I'm
not sure when I'll have time to look into this, but it would be convenient
to have your repository available when I do check it out.
-- 
David Roundy
Department of Physics
Oregon State University
msg3321 (view) Author: droundy Date: 2008-02-11.16:44:02
On Sat, Feb 09, 2008 at 11:53:04AM -0000, Nicolai Richter (nrG) wrote:
> being a new user, I wanted to support Darcs2 as much as possible, using it
> on not-so-important directories.

Thanks, and thanks for the bug report! (which conveniently included just
enough information to get a clue as to what is wrong)

> I have a dir that stores some command shortcuts which I sync across PCs. I
> ran into a failed push and tried to use darcs1 and darcs2 to repair it.

Do you have a copy of both repositories involved? And could you make them
available to me?

...[reordering quotes a bit]
> Looks like there is a hunk that wants to change the file to what it already
> contains.

Actually, it looks like there's a patch here that is corrupt, so darcs2 is
right to fail on check (and/or repair).  The question becomes one of how
this patch was generated.

> P:\bin>darcs_2008-02-06.exe cha -p dcsv -v
> diffing dir...
> Thu Feb 7 12:24:30 Romance Standard Time 2008 xxxx <mail@nixxxxxxxxxxx.de>
>   * add_less_and_dcsv
>   {
>   addfile ./dcs-v.cmd
>   hunk ./dcs-v.cmd 1
>   +"c:\program files\darcs\darcs.exe" %1 -v %2 %3 %4 %5 %6[_^M_][_$_]
>   hunk ./dcs.cmd 1
>   -"c:\program files\darcs\darcs.exe" %1 %2 %3 %4 %5 %6[_^M_][_$_]
>   -
>   +@"c:\program files\darcs\darcs.exe" %1 %2 %3 %4 %5 %6
>   addfile ./less.cmd
>   hunk ./less.cmd 1
>   +more %1 %2 %3 %4[_^M_][_$_]
>   }

The first and second hunk appear to be contradictory:  the second hunk
change removed the first line of the file, which was added by the first
hunk.  But when it's removed, it doesn't match the version of the line that
was added.  :(

Which raises the question: which darcs was it that created this patch?
Also, did you do anything like a recursive search-and-replace that might
have recursed into the _darcs/pristine directory and modified the pristine
cache (which could corrupt the repository)? It seems an unlikely
explanation, given the particular oddness of this patch, but I haven't got
any other explanation for how this patch could have been created.

David
History
Date User Action Args
2008-02-09 11:53:03mail1create
2008-02-09 14:38:41markstossetstatus: unread -> duplicate
topic: + Darcs2, Regression
nosy: + markstos
messages: + msg3262
priority: bug
superseder: + fix bug in bugs/pull.sh test, which now passes.
2008-02-11 16:22:58nicolairichtersetnosy: + nicolairichter
messages: + msg3317
2008-02-11 16:34:32droundysetnosy: droundy, tommy, beschmi, kowey, markstos, mail1, nicolairichter
messages: + msg3319
2008-02-11 16:44:03droundysetnosy: droundy, tommy, beschmi, kowey, markstos, mail1, nicolairichter
messages: + msg3321
2009-08-06 17:53:58adminsetnosy: + jast, Serware, dmitry.kurochkin, darcs-devel, zooko, dagit, mornfall, simon, thorkilnaur, - droundy, mail1, nicolairichter
2009-08-06 20:57:25adminsetnosy: - beschmi
2009-08-10 22:14:22adminsetnosy: + mail1, nicolairichter, - darcs-devel, zooko, jast, dagit, Serware, mornfall
2009-08-25 18:05:20adminsetnosy: + darcs-devel, - simon
2009-08-27 13:54:59adminsetnosy: tommy, kowey, markstos, darcs-devel, thorkilnaur, mail1, nicolairichter, dmitry.kurochkin