darcs

Issue 885 get --to-match 'hash' => _darcs/tentative_pristine: openBinaryFile: does not exist (2.0.0 Regression)

Title get --to-match 'hash' => _darcs/tentative_pristine: openBinaryFile: does not exist (2.0.0 Regression)
Priority urgent Status resolved
Milestone 2.1.x Resolved in
Superseder Nosy List Serware, darcs-devel, dmitry.kurochkin, kowey, lele, markstos, mornfall, thorkilnaur, tommy
Assigned To
Topics Darcs2, Patch, Regression, X_DeprecatedTopic_Testing

Created on 2008-05-29.13:51:30 by lele, last changed 2010-06-15.21:47:50 by admin.

Messages
msg4876 (view) Author: lele Date: 2008-05-29.13:51:28
Hi,

darcs get --to-match 'hash ....' fails with the following message:

  darcs: _darcs/tentative_pristine: openBinaryFile: does not exist (No such file or directory)

as this test shows (I will send a patch introducing it as soon as I
get back the issue number):

#!/bin/sh

set -ev

## I would use the builtin !, but that has the wrong semantics.
not () { "$@" && exit 1 || :; }

rm -rf temp1
mkdir temp1
cd temp1
darcs init
echo first > a
darcs add a
darcs record -am 'first'
firsthash=`darcs changes --xml | grep 'hash=' | sed -e "s/.*hash='//" -e "s/'>//"`
echo second > b
darcs add b
darcs record -am 'second'

cd ..
rm -rf temp2
mkdir temp2
cd temp2
darcs init
echo darcs pull -v -a --match "hash $firsthash" ../temp1
darcs pull -v -a --match "hash $firsthash" ../temp1

cd ..
rm -rf temp3
echo darcs get -v --to-match "hash $firsthash" temp1 temp3
darcs get -v --to-match "hash $firsthash" temp1 temp3

thank you,
ciao, lele.
-- 
nickname: Lele Gaifax    | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas    | comincerò ad aver paura di chi mi copia.
lele@nautilus.homeip.net |                 -- Fortunato Depero, 1929.
msg5455 (view) Author: markstos Date: 2008-08-13.01:47:30
I'm upgrading this ticket to 'urgent' because it's a darcs failure, and also
because it helpfully includes a test case to trigger the bug, which should make
it easier to work on.
msg5472 (view) Author: mornfall Date: 2008-08-13.09:18:40
I believe the problem is here:
in writePatchSet (called by patchSetToRepository), this code here:

    if format_has HashedInventory rf2
       then do HashedRepo.write_tentative_inventory c opts patchset
               HashedRepo.finalize_tentative_changes repo opts

Now write_tentative_inventory does just that: writes tentative_hashed_inventory,
but it does *not* touch anything about tentative_pristine. But
finalize_tentative_changes wants that file. (Note that patchSetToRepository is
called in the "--to-match" path of darcs get.)

(Ah, and the documentation in patchSetToRepository seems to be wrong about
calling error when working with HashedRepo's? It seems to be supposed to work.)

IIUIC, we first need to create an "empty" pristine and write that, because in
hashed repositories, pristine pointer is part of hashed_inventory, which we then
cannot write without one (that's why finish_tentative_changes fails). The call to
pristineFromWorking will fill in the so-far empty pristine then.

If there are no objections to this analysis, I'll post patches in a while (maybe
today, maybe tomorrow).
msg5482 (view) Author: mornfall Date: 2008-08-13.13:08:14
There's a patch on darcs-users@ pending review now.
msg5506 (view) Author: mornfall Date: 2008-08-14.14:56:53
Patch's been rejected because of violating some sort of unwritten rule about
module imports. I have no intention to refactor the surrounding code to appease
these rules just to get the fix through -> unassigning, kthxbai.
msg5544 (view) Author: droundy Date: 2008-08-15.15:38:27
If your code is going  to work around bugs rather than fixing
them, yes, I will ask you to rewrite it.  I gave you a simple way to
tell when this is happening, and now you're going to leave in a huff?
If you don't care about the quality and maintainability of darcs'
code, then we're better off without you.  If you do care about darcs'
quality, you should learn to accept feedback to improve your code.
msg6015 (view) Author: droundy Date: 2008-09-16.17:53:50
The following patch updated the status of issue885 to be resolved:

* resolve issue885: fix patchSetToRepository to work with hashed.
History
Date User Action Args
2008-05-29 13:51:30lelecreate
2008-05-29 16:53:00koweylinkissue886 superseder
2008-05-29 17:06:35koweysetpriority: bug
nosy: tommy, beschmi, dagit, lele
topic: + Regression
title: Regression: "darcs get --to-match" does not work anymore under 2.0 -> get --to-match 'hash' => _darcs/tentative_pristine: openBinaryFile: does not exist (2.0.0 Regression)
2008-08-13 01:47:45markstossetpriority: bug -> urgent
status: unread -> unknown
topic: + Patch, Darcs2, X_DeprecatedTopic_Testing
messages: + msg5455
nosy: + markstos, Serware
2008-08-13 09:18:55mornfallsetnosy: + mornfall, simon, kowey
messages: + msg5472
2008-08-13 13:08:29mornfallsetstatus: unknown -> has-patch
nosy: tommy, beschmi, kowey, markstos, dagit, lele, simon, Serware, mornfall
messages: + msg5482
assignedto: mornfall
2008-08-14 14:57:02mornfallsetstatus: has-patch -> unknown
nosy: + darcs-devel
messages: + msg5506
assignedto: mornfall ->
2008-08-14 15:15:32koweysettopic: + Target-2.1
nosy: tommy, beschmi, kowey, markstos, darcs-devel, dagit, lele, simon, Serware, mornfall
2008-08-15 15:23:09koweysetstatus: unknown -> needs-reproduction
nosy: tommy, beschmi, kowey, markstos, darcs-devel, dagit, lele, simon, Serware, mornfall
2008-08-15 15:29:23droundysetnosy: - darcs-devel
2008-08-15 15:38:39droundysetnosy: + droundy
messages: + msg5544
2008-09-16 17:53:54droundysetstatus: needs-reproduction -> resolved-in-unstable
nosy: droundy, tommy, beschmi, kowey, markstos, dagit, lele, simon, Serware, mornfall
messages: + msg6015
2009-04-22 03:29:58twbsetstatus: resolved-in-unstable -> resolved
nosy: + dmitry.kurochkin, thorkilnaur
2009-08-06 17:59:38adminsetnosy: + jast, darcs-devel, zooko, - droundy, lele
2009-08-06 21:06:15adminsetnosy: - beschmi
2009-08-10 22:21:04adminsetnosy: + lele, - darcs-devel, zooko, jast
2009-08-11 00:15:35adminsetnosy: - dagit
2009-08-25 17:24:05adminsetnosy: + darcs-devel, - simon
2009-08-27 14:18:20adminsetnosy: tommy, kowey, markstos, darcs-devel, lele, thorkilnaur, dmitry.kurochkin, Serware, mornfall
2009-10-23 22:43:49adminsetnosy: + serware, - Serware
2009-10-23 23:29:40adminsetnosy: + Serware, - serware
2010-06-15 21:47:47adminsetmilestone: 2.1.x
2010-06-15 21:47:50adminsettopic: - Target-2.1