There were 9 merges tonight (r1588145:r1588153).  The log messages were
all correct, but the Nth merge removed from STATUS the (2N)th merge's
entry.  As a result, the first merge (N=0) was correct, but the others
either removed the wrong STATUS entry or removed no entry.

I think this is due to a bug in the relatively new $parno handling.  I
believe the parno code wasn't on the VM until yesterday, even though
it's been in HEAD for a while.

The code stows $parno in the %entry structure at parse time, and then
loops over the entries in Approved and merges them.  The first merge
deletes the ($entries[0]->{parno})th paragraph from STATUS.¹  The second
merge then deletes the ($entries[1]->{parno})th paragraph from the
file... which is wrong; it should be deleting the ($entries[1]->{parno} - 1)th
paragraph instead, since the first merge has happened, and
$entries[0]->{parno} < $entries[1]->{parno}.

The fix would be to change the $parno accounting as follows: before
$entry{parno} is used, subtract from it the number of entries already
merged in this run.  (Entries are currently merged in file order, so
none of the already-merged-in-this-run entries would have a ->{parno}
greater than $entry{parno} of the entry about to be merged.)

Daniel

P.S. It would be a good idea to have some sort of test suite for
backport.pl...


¹ There is no @entries array; that was just pseudosyntax for "the first entry".

Reply via email to