[darcs-devel] darcs patch: (add a + mv a b = add b) and (mv a b + remove b = remo...

David Roundy droundy at darcs.net
Tue Jan 9 15:31:26 PST 2007


On Mon, Jan 08, 2007 at 08:31:19AM -0800, malebria at riseup.net wrote:
> Mon Jan  8 14:09:33 BRST 2007  malebria at riseup.net
>   * (add a + mv a b = add b) and (mv a b + remove b = remove a)

> New patches:
> 
> [(add a + mv a b = add b) and (mv a b + remove b = remove a)
> malebria at riseup.net**20070108160933] {
> hunk ./PatchCommute.lhs 1021
> +coalesce (Move a b, FP f AddFile) | f == a = Just $ FP b AddFile
> +coalesce (FP f RmFile, Move a b) | b == f = Just $ FP a RmFile
> }

I think this is probably fine, but it's a little bit scary.  The reason is
that I this change does affect the semantics of a patch.  It's probably
fine, since I think coalesce is only used on pending changes, but I'd like
to see a bit of a review of where coalesce is used, before this patch is
accepted.

And for those who haven't caught on, the idea is that if you do

touch foo
darcs add foo
darcs mv foo bar
darcs whatsnew

should give instead of

{
addfile ./foo
move ./foo ./bar
}

{
addfile ./bar
}

It's a good idea, the only question is whether it's dangerous.  Similarly
for if you rename a file and then delete it.
-- 
David Roundy
Department of Physics
Oregon State University


More information about the darcs-devel mailing list