[darcs-devel] darcs patch: Expose more PatchInfo parts and switch t... (and 1 more)

Eric Y. Kow eric.kow at gmail.com
Sat Jul 28 00:37:55 PDT 2007


> Thu Jul 26 17:13:58 PDT 2007  David Roundy <droundy at darcs.net>
>   * move to pure record-access in Patch.Info.

Looks good, although some suggestions below.

>  just_name :: PatchInfo -> String
> -just_name (PatchInfo _ n _ _ False) = unpackPS n
> -just_name (PatchInfo _ n _ _ True) = "UNDO: " ++ unpackPS n
> +just_name pinf = if is_inverted pinf then "UNDO: " ++ unpackPS (_pi_name pinf)
> +                                     else unpackPS (_pi_name pinf)

We can probably just use pi_name here

> +    <+> text "author='" <> escapeXML (just_author pi) <> text "'"

We probably want this to be pi_author, even thogh they do the same
thing.

> +    fix_up_fname (midtrunc (pi_name pi)++"-"++just_author pi++"-"++unpackPS (_pi_date pi))

Likewise here.

> +               ((td ! [align "right"] << mail_link (just_author pi)) `beside`
> +                (td << (friendly_d $ _pi_date pi)))

And here.

I'm not entirely sure, but my feeling is that the pi_ functions leave
the string a state as possible, where as the just_ functions allow for
some fiddling, specifically the 'UNDO' which just_name adds.  We might
look into renaming some of these functions to make it clear.

Note that I had added pi_name for amend-record, and threw in pi_author
for consistency. Maybe that was unwise...

-- 
Eric Kow                     http://www.loria.fr/~kow
PGP Key ID: 08AC04F9         Merci de corriger mon français.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20070728/810e4e08/attachment-0001.pgp


More information about the darcs-devel mailing list