[darcs-devel] [issue2136] Changes --xml incorrectly lists created_as, for multiple files

Owen Stephens bugs at darcs.net
Sun Jan 22 03:22:02 UTC 2012


New submission from Owen Stephens <darcs at owenstephens.co.uk>:

Given the xml output flag, changes outputs the original filenames of the
filenames passed (so if A' was originally A and moved to A' at some
point, darcs says something to the effect of "originally named A").

The output is sometimes wrong when multiple filenames are passed to
changes. 
Instead, changes will list the original name of the oldest-affected
file, in the following case:
* my repo has files A' and B'
* at some point I renamed (A -> A') and (B -> B')
* and A was added in an older, different patch to B.

then changes A' B' will say "originally named A" not "originally named A,B"

This is because of the way filterPatchesByNames
(src/Darcs/Commands/Changes.hs) works; it folds over the patches in the
repo, if the current patch was an "addfile foo", then foo is removed
from the list of filenames to lookout for, when this list becomes empty,
the previous list is used as the "originally named as" list of
filenames. Instead, the code should notice when any filename has been
removed from the list of to-be-watched filenames, and output these names
accordingly. This might be tricky in the case of moves in the same
commit as adds. (i.e. [A', B] -> [A] in the case of {move A A'; addfile B})

So, unless A and B were added in the same patch, or the list of files
passed to changes is singleton, then this output won't be correct.

----------
messages: 15046
nosy: owst
status: unknown
title: Changes --xml incorrectly lists created_as, for multiple files

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue2136>
__________________________________


More information about the darcs-devel mailing list