On Mon, Aug 01, 2005 at 11:58:53PM -0700, Jason Dagit wrote: > I've been trying to store this postget setting in either _darcs/prefs/ > defaults or ~/.darcs/defaults. I'm having a very hard time fitting > this into the current framework. Following the example set by > show_motd, I have a function (untested) that I think will grab the > (possibly) remote _darcs/prefs/defaults file and return it as an IO > String. I want to then process that the normal way (the way > get_default_flag would do it). Any ideas? I've just spent quite a > bit of time on it and I'm stumped as to a simple way of doing it. > Looking at things I don't think a remote path such as URL can be used > with 'ReadableDirectory m'.
The only thing that should be stored in defaults are command-line flags. If you define a flag that works like darcs get --post-hook='echo hello world' then you should be able to do echo get --post-hook echo hello world >> ~/.darcs/defaults and then any get run on this machine will use that post-hook. You shouldn't read defaults yourself, the code's already written that does that. If you want to use the *remote* defaults, that's another issue. But you shouldn't ever stick anything in defaults that isn't a valid flag. (Users could mistakenly do so, and we should be forgiving in parsing the file, but darcs shouldn't ask them to do so.) Note that getting this (local, using ~/.darcs/defaults) get --post-hook working should require the same effort as an apply post-hook, if done right. -- David Roundy http://www.darcs.net _______________________________________________ darcs-devel mailing list [email protected] http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel
