[darcs-users] darcs patch: make rollback smarter about breaking up ... (and 5 more)

Eric Kow kowey at darcs.net
Tue Mar 17 09:28:10 UTC 2009

On Tue, Mar 17, 2009 at 11:51:05 +1100, Trent W. Buck wrote:
> I have only commented on the patches I understand.


> Eric Kow <kowey at darcs.net> writes:
> > fix bug in put of darcs-1 format repositories.
> > ----------------------------------------------------------------------
> This one makes sense to me, I guess it was broken by Darcs 2.2.0, which
> made darcs-2 the default format.


> > use exitWith under record, when no patches are selected (to not run posthook).
> > ------------------------------------------------------------------------------
> I'm not keen on calling exit(3) all over the place, because it
> effectively gives your function/command/whatever multiple exit points
> and makes it harder to reason about.

So I haven't had time yet to digest your mail, but is this patch
(which has long been applied) relevant?

Sun Nov 16 23:05:21 GMT 2008  David Roundy <droundy at darcs.net>
  * don't run posthook if the command terminated with exitWith.
  This is a change in policy, and means that for instance darcs pull -a will
  only run the posthook if there are patches to pull.  It does mean that we
  have to be careful how we exit commands, since this adds new meaning to
  "exitWith ExitSuccess", but my audit of the code shows that this is only
  used when I wouldn't want to run the posthook anyhow.

> > clean up Depends a wee tad
> > --------------------------
> > -                 Left e -> throwError (MissingPatch (info hp) e)
> > +                 Left e -> Left (MissingPatch (info hp) e)
> Does this make the code more obscure?  I don't know how strong the
> association of Left with "this is an error" is within the Haskell
> community, but to me the change looks to make things harder to
> understand merely to avoid importing one extra thingy.

I can't speak for the Haskell community, but it's pretty strong to me, using
the Left e for the error condition and the Right for the successful one.

Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090317/113f64ee/attachment.pgp>

More information about the darcs-users mailing list