darcs

Issue 142 darcs record --logfile doesn't Notice Missing File.

Title darcs record --logfile doesn't Notice Missing File.
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, markstos, ralph, thorkilnaur, tommy
Assigned To
Topics ProbablyEasy

Created on 2006-03-01.09:41:47 by kowey, last changed 2009-09-04.17:38:43 by kowey.

Messages
msg529 (view) Author: kowey Date: 2006-03-01.09:41:45
From RT #350
http://otherbugs.darcs.net//Ticket/Display.html?id=350

Darcs lets you say 'darcs record --logfile=foo' where foo does not actually
exist, which is annoying because you've then recorded a patch without any long
comments.  

Ralph, since I got it wrong the first time, could you please confirm my new
understanding of your patch?

This looks like something a beginning darcs developer could implement.
msg530 (view) Author: ralph Date: 2006-03-01.10:25:54
I haven't submitted the patch, but the bug report's about right.

Basically, if you tell darcs to read information from a file, and the file
doesn't exist, then darcs should complain and stop without carrying out the
operation.  --logfile is one example of a situation where it doesn't.  The
original bug report, linked to above, says that this may not be the only option
that misbehaves in this way.
msg1762 (view) Author: tommy Date: 2007-06-29.19:39:49
fixed in 1.0.9
msg1790 (view) Author: ralph Date: 2007-06-30.10:28:18
What's fixed in 1.0.9?  Just --logfile or other options that may misbehave?
msg1791 (view) Author: tommy Date: 2007-06-30.14:43:08
Darcs will exit with failure if the file given to --logfile doesn't exist.

There are no changes to other options. I don't know which these would be, but I
guess them treating non-existing files as empty causes darcs to fail in an
non-surprisingly way, or no one is using them...

Ok, I just did a grep on the darcs 1.0.9 source for readBinFile, `catch` and
`catchall`, and found no one replacing a missing option file with the empty
string. This is of cource not an exhaustive proof, but a strong indication, so
I'm closing this bug. Please open a new spesific bug if you find any such.

(Just for fun i tried 'darcs get --context does-not-exist .', and found a bugish
behaviour, so I'll open a new bug for that one.)
msg6960 (view) Author: markstos Date: 2009-01-03.14:20:08
I believe I noticed this bug with darcs 2.0.2. I had used:

darcs record --logfile=missing-file.txt

And darcs still started the 'record' process, instead of immediately exiting
with an error. We should check out test suite to make sure this case is covered.
msg8690 (view) Author: kowey Date: 2009-09-04.17:38:41
This appears to be have been resolved somewhere between 2.0.2 and 2.3.0.
In any case, this test passess:

rm -rf R                        # Another script may have left a mess.
darcs init      --repo R        # Create our test repos.
cd R
touch f g
touch log
darcs     record -alm f --logfile log     f
not darcs record -alm g --logfile missing g

Ideally, to be thorough we would make sure that it fails in 2.0.2
History
Date User Action Args
2006-03-01 09:41:47koweycreate
2006-03-01 10:25:57ralphsetstatus: unread -> unknown
nosy: + ralph
messages: + msg530
2006-08-06 21:59:28koweysettopic: + ProbablyEasy
nosy: droundy, tommy, kowey, ralph
2006-09-01 01:04:53jchsetstatus: unknown -> resolved-in-unstable
nosy: droundy, tommy, kowey, ralph
2006-09-30 12:26:21tommysetstatus: resolved-in-unstable -> resolved-in-stable
nosy: droundy, tommy, kowey, ralph
2007-06-29 19:39:49tommysetstatus: resolved-in-stable -> resolved
nosy: + beschmi
messages: + msg1762
2007-06-30 10:28:20ralphsetstatus: resolved -> unknown
messages: + msg1790
2007-06-30 14:43:10tommysetstatus: unknown -> resolved
messages: + msg1791
2009-01-03 14:20:11markstossetstatus: resolved -> needs-reproduction
nosy: + markstos, dmitry.kurochkin, thorkilnaur, simon
messages: + msg6960
2009-08-06 17:33:47adminsetnosy: + jast, Serware, darcs-devel, zooko, dagit, mornfall, - droundy, ralph
2009-08-06 20:31:11adminsetnosy: - beschmi
2009-08-10 21:44:26adminsetnosy: + ralph, - darcs-devel, zooko, jast, dagit, Serware, mornfall
2009-08-25 17:37:52adminsetnosy: + darcs-devel, - simon
2009-08-27 14:14:19adminsetnosy: tommy, kowey, markstos, darcs-devel, ralph, thorkilnaur, dmitry.kurochkin
2009-09-04 17:38:43koweysetstatus: needs-reproduction -> resolved
nosy: tommy, kowey, markstos, darcs-devel, ralph, thorkilnaur, dmitry.kurochkin
messages: + msg8690