[darcs-devel] [issue1572] darcs get can retrieve a not-yet-recorded setpref setting

Eric Kow bugs at darcs.net
Thu Aug 27 00:54:56 UTC 2009


New submission from Eric Kow <kowey at darcs.net>:

I intend to submit something like this as a test:

. ../tests/lib                  # Load some portability helpers.
rm -rf R S S2                   # Another script may have left a mess.
darcs init      --repo R        # Create our test repos.

echo 'boringfile fake-boring' > R/_darcs/prefs/prefs
darcs get R S
not test -e S/_darcs/prefs/prefs

rm R/_darcs/prefs/prefs
darcs setpref --repo R boringfile fake-boring
darcs get R S2
not test -e S/_darcs/prefs/prefs

In both of these cases, we can see that it's possible to fetch a setpref setting
that wasn't actually recorded.

This isn't a serious bug, more a nuisance than anything else.  Introducing
setpref corruption into darcs seems all too easy.  "Luckily", setpref is so dumb
that this sort of corruption doesn't affect Darcs operation in any serious way
(except to give surprising results) and is easy to recover from.

In case of corruption, I the workaround is to use darcs changes to look for
changepref patches and then manually write the last changepref.

Fixing this bug seems tricky.  I imagine you want some part of the pristine
cache set aside for darcs metadata so that you can have a pristine/working
distinction for prefs.

I think we'd need somebody to think about the problem and work out a way either
(a) of doing it with backward compatibility -- so that it doesn't confuse old
darcs or (b) just conclude that it can't be done without a minor repo format
change, which is fine too.

----------
messages: 8522
nosy: darcs-devel, dmitry.kurochkin, kowey
priority: bug
status: need-action
title: darcs get can retrieve a not-yet-recorded setpref setting

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1572>
__________________________________


More information about the darcs-devel mailing list