[darcs-users] darcs patch: Wrap ShowRepo output within a <repositor... (and 2 more)

David Roundy droundy at darcs.net
Sat May 17 12:37:15 UTC 2008


On Sat, May 17, 2008 at 01:42:10PM +0200, lele at nautilus.homeip.net wrote:
> Hi all,
> 
> these patches are the result of my attempt to learn Haskell little by
> little: I'm almost sure they aren't good enough [yet] to be accepted,
> but I really like to hear anything could help me.

They actually look basically fine.  The mixture of output that push
--dry-run --xml generates is a bit weird.  I think I'd prefer for this to
be all-xml.

> The first one is just syntactic sugar, not related to the others, and
> it can go to /dev/null if not appropriate.

It's fine with me, as long as the change doesn't bother any other xml users
out there.

> The problem I'm trying to cure is with tools like tailor: it basically
> needs to get a list of patches that are missing, then it fetch those
> one by one committing each one on the target VCS.
> 
> Tailor currently parses the output of "darcs pull --dry-run" to
> compute the hash of each patch, and then uses it to do a "darcs pull
> --match 'hash xxx'". This works "great", for patches born *after*
> around november 2003, while for older patches it fails to compute the
> hash (due a change in darcs handling of UTC timestamps, see comment
> near line 100 of Darcs/Patch/Info.lhs).

Right, that's ugly, but well-nigh unavoidable...  :(

> Thank you,
> bye, lele.
> 
> 
> Wed May 14 19:40:50 CEST 2008  lele at nautilus.homeip.net
>   * Wrap ShowRepo output within a <repository> tag, when asked for XML output
> 
> Sat May 17 13:08:20 CEST 2008  lele at nautilus.homeip.net
>   * Honour --xml-output when printing the patches in the "will do"/"would do" message
> 
> Sat May 17 13:21:35 CEST 2008  lele at nautilus.homeip.net
>   * Added --xml-output to the pull command
>   This currently works only in tandem with --dry-run: it's needed by tools
>   like `tailor`, which wants to know the exact list of patches darcs would
>   pull, and then driving it to get one at a time, to commit each patch on
>   the target system.

I've applied the first two, but didn't apply the third one, and instead
wrote a little patch of my own which made it so users of dry_run
automatically include the --xml flag.  The catch is that add --dry-run
doesn't use print_dryrun_messages_and_exit, so I had to add a special case
so that add wouldn't include an xml flag that has no effect.  It'd be nicer
to add xml support to add for consistency.

Thanks! (and you seem to be doing pretty well in Haskell already)

David


More information about the darcs-users mailing list