I would naively expect that amend-record is just a convenient way to do
unrecord followed by record. However, as the following sequence
demonstrates, it's possible to get different results. I can understand (at
a high level) how this might happen, but I think it ought to be classed as
a bug. The impact of the current behaviour is that the amend-recorded
patch has extra junk in it, and is more likely to conflict with other
patches. So to get "clean" patches I find myself using unrecord/record
instead of amend-record, and that's bad.
Ideally:
* recording a change A and then amend-recording it to B, should give
the same patch as just recording B in the first place.
* amend-recording a patch should give the same results as unrecord
followed by record.
* If I amend-record a patch, then unrecord+record on that patch should
be a no-op.
In all cases, by "the same patch" I mean the same set of hunks.
simple script to demonstrate the difference:
#! /bin/sh
mkdir test
cd test
darcs init
printf "a\nb\nc\nd\n" >x
darcs add x
darcs rec -a -m "add x"
# First the amend-record sequence
printf "AAA\nBBB\nCCC\nDDD\n" >x
darcs rec -a -m patch
printf "AAA\nb\nc\nDDD\n" >x
yes | darcs amend-record -a -p patch
echo "PATCH AFTER AMEND-RECORD:"
darcs changes --no-summary -v -p patch
yes | darcs unpull -p patch
# Now just recording the patch:
printf "AAA\nb\nc\nDDD\n" >x
darcs rec -a -m patch
echo "PATCH AFTER RECORD:"
darcs changes --no-summary -v -p patch
|