darcs

Issue 1155 darcs query contents => darcs failed: Error applying hunk to file

Title darcs query contents => darcs failed: Error applying hunk to file
Priority bug Status duplicate
Milestone Resolved in
Superseder rmfile patch created without the actual content removal (tailor)
View: 693
Nosy List darcs-devel, dmitry.kurochkin, kowey, thorkilnaur, zooko
Assigned To
Topics

Created on 2008-10-22.22:49:03 by zooko, last changed 2009-08-27.14:34:13 by admin.

Messages
msg6391 (view) Author: zooko Date: 2008-10-22.22:48:59
As earlier posted to darcs-users, invoking

darcs query contents --quiet --match "hash  
20030521193910-96760-42b1e6ee4f6a178dbfde88c3070e917620964253.gz"  
"Makefile"

on the darcs darcs repository with darcs-2.1.0 results in:

failed: 2,
darcs failed:  Error applying hunk to file ./Patch.lhs

Dang it!  I just tried to reproduce it and I can't.  The exact same  
web query through trac prompts trac to execute the exact same darcs  
command-line, but this time it works.  Also it works if I execute  
that command-line from bash.

Argh!  How does irreproducbility sneak into this?  It *ought* to be a  
deterministic function.

By the way, it takes about 15 seconds to execute.  Hence the original  
"optimizing annotate" motivation for looking at this...

Regards,

Zooko	

Begin forwarded message:

> From: zooko <zooko@zooko.com>
> Date: October 22, 2008 16:03:41 PM MDT
> To: Ganesh Sittampalam <ganesh@earth.li>
> Cc: darcs-users@darcs.net
> Subject: Re: [darcs-users] behaviour of darcs annotate
>
>
> On Oct 22, 2008, at 13:57 PM, Ganesh Sittampalam wrote:
>
>> On Wed, 22 Oct 2008, zooko wrote:
>>
>>> Great!  Once "darcs annotate" is fast then the darcs source code
>>> browser
>>> [1] will stop getting time-outs from Trac due to it taking longer
>>> than
>>> 30 seconds to run an annotate.
>>
>> Could you let me know how that calls annotate? i.e with what
>> command-line
>> options.
>
> Sure.
>
> If you hit this front page:
>
> http://allmydata.org/trac/darcs-2/browser
>
> Then it does the following series of invocations of darcs:
>
> darcs query contents --quiet --match "hash
> 20081020182156-72aca-1130292ee981f563df5b3b597a5ce9b8c220e8b2.gz"
> "GNUmakefile"
> darcs query contents --quiet --match "hash 20080919071358-
> c31ef-8202a1a3f97fa2c322a6a9cfba9bcb87c2c6f42b.gz" "autoconf.mk.in"
> darcs query contents --quiet --match "hash 20081010134727-72aca-
> aa7ed25dc493d1d79bd8d2b7406aa79b1098ac5e.gz" "configure.ac"
> darcs query contents --quiet --match "hash 20081010134727-72aca-
> aa7ed25dc493d1d79bd8d2b7406aa79b1098ac5e.gz" "aclocal.m4"
> darcs query contents --quiet --match "hash 20081020200931-72aca-
> cdd2b1802d196b0cd806966a224fbe4e9095d761.gz" "Setup.hs"
>
> Then if you click on GNUmakefile, it does this:
>
> darcs query contents --quiet --match "hash
> 20081020182156-72aca-1130292ee981f563df5b3b597a5ce9b8c220e8b2.gz"
> "GNUmakefile"
>
> Then if you click on "Annotate" (top right corner when viewing the
> GNUmakefile), it does this:
>
> darcs annotate --xml-output --match "hash
> 20081020182156-72aca-1130292ee981f563df5b3b597a5ce9b8c220e8b2.gz"
> GNUmakefile
>
> Again.  Although actually I think trac+darcs notices that it already
> knows the answer in its cache and does not actually invoke darcs  
> again:
>
> 2008-10-22 14:54:12,604 Trac[repository] DEBUG: Cache hit GNUmakefile
> at rev 6447
>
> Then if you click on the revision number "445" in the left-hand
> column at line one of the file, it does this:
>
> darcs query contents --quiet --match "hash
> 20030521161034-96760-2dbfb6199b275601e825e40e0fb5a080ffc0b107.gz"
> "Makefile"
> darcs query contents --quiet --match "hash
> 20030521193910-96760-42b1e6ee4f6a178dbfde88c3070e917620964253.gz"
> "Makefile"
>
> Whoops!  Then it gets an internal error in darcs!
>
>          2008-10-22 14:57:12,579 Trac[main] WARNING: 500 Darcs
> execution failed (Running (cd /home/source/darcs/darcs-2/trunk-
> hashedformat; TZ=UTC darcs query contents --quiet --match "hash
> 20030521193910-96760-42b1e6ee4f6a178dbfde88c3070e917620964253.gz"
> "Makefile") failed: 2,
> darcs failed:  Error applying hunk to file ./Patch.lhs
> : )
>
> trac@org:~/projects/darcs-2$ darcs --version
> 2.1.0 (+ 2 patches)
>
>
> Regards,
>
> Zooko
>
> ---
> http://allmydata.org -- Tahoe, the Least-Authority Filesystem
> http://allmydata.com -- back up all your files for $10/month
>
> _______________________________________________
> darcs-users mailing list
> darcs-users@darcs.net
> http://lists.osuosl.org/mailman/listinfo/darcs-users

---
http://allmydata.org -- Tahoe, the Least-Authority Filesystem
http://allmydata.com -- back up all your files for $10/month
msg6972 (view) Author: thorkilnaur Date: 2009-01-05.13:28:14
Hello Zooko,

Have you experienced this problem again? Or should we perhaps just "presume-
dead" this issue?

Thanks and best regards
Thorkil
msg6987 (view) Author: zooko Date: 2009-01-05.16:29:47
I don't think it can be presumed to be dead.  Has darcs changed in some way that
might fix a bug like this?  Maybe something to do with management of shared
state by multiple darcs processes at once?  I know that a bug like that has been
fixed concerning multiple darcs processes pulling patches in at once  (the bug
with the -new file in the darcs dir).  Could that change have also fixed this
behavior?
msg7872 (view) Author: zooko Date: 2009-06-03.22:30:03
Well, this hasn't recurred.  I guess we might as well presumed-dead it and if I 
see it again I'll re-open this ticket.
msg7874 (view) Author: zooko Date: 2009-06-03.23:26:34
Aha!  No sooner did I presume it dead than it happened again:

2009-06-03 16:24:04,590 Trac[main] WARNING: 500 Darcs execution failed (Running
(cd /home/source/darcs/cryptopp/trunk; TZ=UTC darcs query contents --quiet
--match "hash 20021004173141-0a92f-c0577d6
38d82f8a637dccd37c1a419ead9464250.gz" "tailor.config") failed: 2,
darcs failed:  Error applying hunk to file ./c5/dlie2048.dat
: )
msg7875 (view) Author: zooko Date: 2009-06-03.23:27:49
Hooray, this time it is fully reproducible.  (Maybe this means it is a different
underlying bug than the earlier, irreproducible, one...)

trac@org:/home/source/darcs/cryptopp/trunk$ darcs query contents --quiet --match
"hash 20021004173141-0a92f-c0577d638d82f8a637dccd37c1a419ead9464250.gz"
"tailor.config"

darcs failed:  Error applying hunk to file ./c5/dlie2048.dat
trac@org:/home/source/darcs/cryptopp/trunk$ darcs query contents --quiet --match
"hash 20021004173141-0a92f-c0577d638d82f8a637dccd37c1a419ead9464250.gz"
"tailor.config"

darcs failed:  Error applying hunk to file ./c5/dlie2048.dat
trac@org:/home/source/darcs/cryptopp/trunk$ darcs query contents --quiet --match
"hash 20021004173141-0a92f-c0577d638d82f8a637dccd37c1a419ead9464250.gz"
"tailor.config"

darcs failed:  Error applying hunk to file ./c5/dlie2048.dat
trac@org:/home/source/darcs/cryptopp/trunk$ darcs query contents --quiet --match
"hash 20021004173141-0a92f-c0577d638d82f8a637dccd37c1a419ead9464250.gz"
"tailor.config"

darcs failed:  Error applying hunk to file ./c5/dlie2048.dat
msg7876 (view) Author: zooko Date: 2009-06-04.01:53:13
You can get a copy of this repository yourself from:
http://allmydata.org/source/cryptopp/trunk/

Ah, I see that this is actually a case of issue693!

source@org:~/darcs/cryptopp/trunk-darcs2format$ darcs check
WARNING: Fixing removal of non-empty file ./c5/dlie1024.dat
WARNING: Fixing removal of non-empty file ./c5/dlie2048.dat

WARNING: Fixing removal of non-empty file ./c5/havalcer.dat
WARNING: Fixing removal of non-empty file ./c5/haval.cpp
WARNING: Fixing removal of non-empty file ./c5/haval.h
WARNING: Fixing removal of non-empty file ./c5/md5mac.cpp
WARNING: Fixing removal of non-empty file ./c5/md5mac.h
WARNING: Fixing removal of non-empty file ./c5/xormac.h




WARNING: Fixing removal of non-empty file ./c5/crypto++.mcp
WARNING: Fixing removal of non-empty file ./c5/modexppc.cpp
WARNING: Fixing removal of non-empty file ./c5/diamond.dat
WARNING: Fixing removal of non-empty file ./c5/cryptest.cpp
WARNING: Fixing removal of non-empty file ./c5/diamond.cpp
WARNING: Fixing removal of non-empty file ./c5/diamond.h
WARNING: Fixing removal of non-empty file ./c5/diamondt.cpp



WARNING: Fixing removal of non-empty file ./c5/sapphire.cpp
WARNING: Fixing removal of non-empty file ./c5/sapphire.h

Looks like we have a difference...
Nothing

Inconsistent repository!
Found broken patches.
source@org:~/darcs/cryptopp/trunk-darcs2format$ darcs repair
WARNING: Fixing removal of non-empty file ./c5/dlie1024.dat
WARNING: Fixing removal of non-empty file ./c5/dlie2048.dat

WARNING: Fixing removal of non-empty file ./c5/havalcer.dat
WARNING: Fixing removal of non-empty file ./c5/haval.cpp
WARNING: Fixing removal of non-empty file ./c5/haval.h
WARNING: Fixing removal of non-empty file ./c5/md5mac.cpp
WARNING: Fixing removal of non-empty file ./c5/md5mac.h
WARNING: Fixing removal of non-empty file ./c5/xormac.h




WARNING: Fixing removal of non-empty file ./c5/crypto++.mcp
WARNING: Fixing removal of non-empty file ./c5/modexppc.cpp
WARNING: Fixing removal of non-empty file ./c5/diamond.dat
WARNING: Fixing removal of non-empty file ./c5/cryptest.cpp
WARNING: Fixing removal of non-empty file ./c5/diamond.cpp
WARNING: Fixing removal of non-empty file ./c5/diamond.h
WARNING: Fixing removal of non-empty file ./c5/diamondt.cpp



WARNING: Fixing removal of non-empty file ./c5/sapphire.cpp
WARNING: Fixing removal of non-empty file ./c5/sapphire.h

Writing out repaired patches...
Fixing pristine tree...


That's somewhat disheartening, as issue693 was resolved.  I created this
darcs-2-format repository using darcs-2.2.0 (release).

I will next (a) attempt to reproduce this, (b) update issue693, (c) see if the
repository in which I earlier reported this "Error applying hunk to file" passes
"darcs check".
msg7877 (view) Author: zooko Date: 2009-06-04.01:55:12
Okay as to my step (c) from the previous change note, the other repository (the
darcs-2 repository which is behind http://allmydata.org/trac/darcs-2/browser )
passes "darcs check".  It is  *possible* that it *did* have this problem in the
past and that I ran "darcs repair" on it without noticing, but improbable. 
Anyway, I hereby predict that this ticket will start creeping towards
"presumed-dead" again while we concentrate on issue693...
msg8532 (view) Author: kowey Date: 2009-08-27.10:02:34
This is likely a duplicate of issue693 (which is now better understood: tailor
and pending patch related troubles)
History
Date User Action Args
2008-10-22 22:49:03zookocreate
2009-01-05 13:28:16thorkilnaursetpriority: bug
status: unread -> waiting-for
messages: + msg6972
nosy: kowey, zooko, dagit, simon, thorkilnaur, dmitry.kurochkin
2009-01-05 16:29:50zookosetnosy: kowey, zooko, dagit, simon, thorkilnaur, dmitry.kurochkin
messages: + msg6987
2009-06-03 22:30:07zookosetstatus: waiting-for -> given-up
nosy: kowey, zooko, dagit, simon, thorkilnaur, dmitry.kurochkin
messages: + msg7872
2009-06-03 23:26:38zookosetstatus: given-up -> has-patch
nosy: kowey, zooko, dagit, simon, thorkilnaur, dmitry.kurochkin
messages: + msg7874
title: behaviour of darcs annotate -> darcs query contents => darcs failed: Error applying hunk to file
2009-06-03 23:27:51zookosetnosy: kowey, zooko, dagit, simon, thorkilnaur, dmitry.kurochkin
messages: + msg7875
2009-06-04 01:53:17zookosetnosy: kowey, zooko, dagit, simon, thorkilnaur, dmitry.kurochkin
messages: + msg7876
2009-06-04 01:55:14zookosetnosy: kowey, zooko, dagit, simon, thorkilnaur, dmitry.kurochkin
messages: + msg7877
2009-08-10 23:48:45adminsetnosy: - dagit
2009-08-25 17:31:43adminsetnosy: + darcs-devel, - simon
2009-08-27 10:02:36koweysetstatus: has-patch -> duplicate
nosy: kowey, darcs-devel, zooko, thorkilnaur, dmitry.kurochkin
superseder: + rmfile patch created without the actual content removal (tailor)
messages: + msg8532
2009-08-27 14:34:13adminsetnosy: kowey, darcs-devel, zooko, thorkilnaur, dmitry.kurochkin