[darcs-devel] [patch1289] purify Darcs.UI.Defaults, fixing two problems on the way

Ben Franksen bugs at darcs.net
Tue Mar 10 12:19:10 UTC 2015


Ben Franksen <benjamin.franksen at helmholtz-berlin.de> added the comment:

Final update for this patch bundle. Changed w.r.t. the previous version:

* add a small patch to rectify spelling of messages from
Darcs.UI.Defaults

* rename the replacement 'fail' from 'giveup' to 'die' (like in Perl).

I am going to screen this now.

5 patches for repository http://darcs.net/screened:

patch e1ed3b126134983f223ae0907dad11e2d1dcb3da
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Fri Feb 13 03:17:12 CET 2015
  * beautified error messages for command line and default files

patch fbf4af538131009e0929b6b6429d154706b97fd5
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Sun Feb 22 22:14:01 CET 2015
  * purify Darcs.UI.Defaults, fixing two problems on the way
  
  The IO that was in Darcs.UI.Defaults has been moved to the caller
  (Darcs.UI.RunCommand.runCommand). This allows us to fix a regression:
  relative paths given as option arguments in defaults files were not resolved
  with respect to the same working directory as when giving the option on the
  command line. The ordering constraints of commandPrereq vs.
  getGlobal/getPreflist are now concentrated in one place and documented.
  
  Some changes related to errors and how to report them are also included in
  this patch since it would have been difficult to record them separately:
  
  - applyDefaults no longer stops on the first error, instead accumulates all
    errors and returns them together with the result in a pair. This makes it
    easy to postpone the actual failure to a point after the standard command
    actions (--help, --list-options, --disable) have been handled. Which in
    turn fixes a problem with the generalized contrib/_darcs.zsh.
  
  - replacing use of unlines with (intercalate "\n") when concatenating error
    messages avoids many uses of the ugly chompTrailingNewline
  
  - error messages returned by getOpt and those generated by applyDefaults are
    now in the same format

patch 71da2492bd3a0cb5bd35679be9bb99343368a161
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Sat Mar  7 13:25:46 CET 2015
  * Darcs.UI.Defaults: upper case initial letter in error messages
  
  This brings it in line with how messages in Darcs are formatted elsewhere.

patch c4a5824efdb07c49ddb9dc2c828bd59031702626
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Tue Mar 10 12:54:23 CET 2015
  * added die action to Darcs.Util.Exception as a replacement for fail
  
  It is commonly agreed upon that fail is an ugly wart in the Monad class and
  should not be used for serious programs. Its only sensible justification is
  to support de-sugaring of do blocks with failing pattern matches.

patch e90c41bea6050fd35d7a56ad7a8c702bfd5bb80c
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Tue Mar 10 12:58:16 CET 2015
  * use die instead of fail in Darcs.UI.RunCommand

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1289>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-preview.txt
Type: text/x-darcs-patch
Size: 18127 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150310/3db562cb/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: beautified-error-messages-for-command-line-and-default-files.dpatch
Type: application/x-darcs-patch
Size: 32540 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150310/3db562cb/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unnamed
Type: application/octet-stream
Size: 5 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150310/3db562cb/attachment-0001.obj>


More information about the darcs-devel mailing list