[darcs-devel] [darcs #349] Dependencies among setpref changes to the same option are not enforced

via RT bugs at darcs.net
Fri Apr 15 11:05:07 PDT 2005


Fri Apr 15 14:05:05 2005: New ticket: 349.
Transaction: Ticket created by guest
       Queue: Darcs
     Subject: Dependencies among setpref changes to the same option are not
 enforced
       Owner: Nobody
  Requestors: seh at panix.com
      Status: new
 Ticket <URL: http://bugs.darcs.net/.//Ticket/Display.html?id=349 >

I noticed that darcs will happily allow me to perform any number
of successive "setpref" operations against the same option and commit
any subset of them with "record". The resulting patch set has some
strange possibilities for "unrecord" and "revert".

Consider:

$ darcs setpref boringfile foo
Changing value of boringfile from '' to 'foo'

$ darcs setpref boringfile bar
Changing value of boringfile from 'foo' to 'bar'

$ darcs setpref boringfile baz
Changing value of boringfile from 'bar' to 'baz'

$ darcs whatsnew
{
changepref boringfile
foo
bar
changepref boringfile
bar
baz
changepref boringfile

foo
}


First, the change order is strange. Next, running "record" shows that
there are no dependencies among these preference changes. If I commit
only the first one ("foo"->"bar"), then unrecording and reverting my
repository will incorrectly restore the "baz" setting to
"foo". Committing just one of these changes should not be possible.

Rather, what I think should happen is that there should only be a
single "changepref" entry for any given option in a patch. In the
example above, reverting the final "baz" preference should really go
all the way back to "", or the empty setting.

To make that that happen, darcs could proceed as follows:

o Upon a setpref operation, see if a changepref entry exists in
  pending for the given option.
o If not, insert a changepref entry.
o Otherwise, replace the existing changepref entry with a new one
  preserving the original "old" setting and using the new "new"
  setting.

Something like this already happens with successive moves ("mv") of
files and directories. If I move a to b, then b to c, darcs only
records "a->c".




More information about the darcs-devel mailing list