[darcs-devel] darcs patch: Amending a patch doesn't remove explicit dependencies

Tommy Pettersson ptp at lysator.liu.se
Thu Nov 16 03:07:59 PST 2006


On Thu, Nov 16, 2006 at 09:17:26AM +0000, Edwin Thomson wrote:
> For issue 328.  It's not the more complete solution suggested that 
> allows asking for more dependencies - it just copies across the old 
> explicit dependencies.

> [Amending a patch doesn't remove explicit dependencies
> edwin.thomson at gmail.com**20061110222837] {

I've reviewed this patch, and I think it's fine. I have some
suggestions though.

If you put (issue328) somewhere in the patch name, it's easier
to trace bugs and changes later.

> hunk ./AmendRecord.lhs 155
> -    infopatch (set_pi_date d pinf) $
> +    infodepspatch (set_pi_date d pinf) pdeps $

How about something like this instead:

      let ...
          infodepspatch pinfo pds p = adddeps (infopatch pinfo p) pds
      in
      infodepspatch (set_pi_date d pinf) pdeps $
      ...

Then there is no need to export from Patch one more function
with one more interface that does almost the same thing. I'm not
totally sure this is a good idea, but keeping module interfaces
small and orthogonal is a generally good idea.

To get a simple implementation of --ask-deps, fixp could take
the deps as argument, and it would be the job of amendrecord_cmd
to either ask for them if the --ask-deps flag was given
(discarding the old ones), or else getdeps the old ones.



-- 
Tommy Pettersson <ptp at lysator.liu.se>




More information about the darcs-devel mailing list