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

Ben Franksen bugs at darcs.net
Sun Feb 22 22:25:02 UTC 2015


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

This bundle obsoletes the earlier one. Here is an example for the integrated
error messages:

> darcs record -i -a --bla
command line: unrecognized option `--bla'
command line: conflicting options: interactive, all/no-interactive

This what you get if you add a line

  ALL --bad

to your defaults file:

> darcs record -i -a --bla
command line: unrecognized option `--bla'
command line: conflicting options: interactive, all/no-interactive
user defaults: command 'record' has no option 'bad'.


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

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 017b7bcc7ee5dba59e858aa61cabffe66870b7e1
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Sun Feb 22 19:30:26 CET 2015
  * added giveup 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 bec40a8e29ef0795ec64696ad142b3a691276eba
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Sun Feb 22 22:15:10 CET 2015
  * use giveup 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: 14736 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150222/d8d969f3/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: purify-darcs_ui_defaults_-fixing-two-problems-on-the-way.dpatch
Type: application/x-darcs-patch
Size: 29330 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150222/d8d969f3/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unnamed
Type: application/octet-stream
Size: 7 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150222/d8d969f3/attachment-0001.obj>


More information about the darcs-devel mailing list