darcs

Issue 2136 Changes --xml incorrectly lists created_as, for multiple files

Title Changes --xml incorrectly lists created_as, for multiple files
Priority Status resolved
Milestone Resolved in 2.10.0 HEAD
Superseder Nosy List owst
Assigned To
Topics

Created on 2012-01-22.03:22:02 by owst, last changed 2012-03-31.01:26:30 by noreply.

Messages
msg15046 (view) Author: owst Date: 2012-01-22.03:22:00
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.
msg15066 (view) Author: noreply Date: 2012-01-28.14:20:05
The following patch sent by Owen Stephens <darcs@owenstephens.co.uk> updated issue Issue2136 with
status=has-patch

* Resolve Issue2136: Correctly track renames of multiple files in Changes --xml. 
Ignore-this: 4429aad5da83936189e05b4c6fddf9e9
For each file passed to Changes, track its original name, and show the first
patch that created it. Update lookTouch to track exactly which files are
touched, and renames. Create utility function to provide old behaviour of just
obtaining the effect of the patch on a filepath list.
msg15442 (view) Author: noreply Date: 2012-03-31.01:26:29
The following patch sent by Owen Stephens <darcs@owenstephens.co.uk> updated issue Issue2136 with
status=resolved;resolvedin=2.10.0 HEAD

* Resolve Issue2136: Correctly track renames of multiple files in Changes --xml. 
Ignore-this: 4429aad5da83936189e05b4c6fddf9e9
For each file passed to Changes, track its original name, and show the first
patch that created it. Update lookTouch to track exactly which files are
touched, and renames. Create utility function to provide old behaviour of just
obtaining the effect of the patch on a filepath list.
History
Date User Action Args
2012-01-22 03:22:02owstcreate
2012-01-28 14:20:06noreplysetstatus: unknown -> has-patch
messages: + msg15066
2012-03-31 01:26:30noreplysetstatus: has-patch -> resolved
messages: + msg15442
resolvedin: 2.10.0 HEAD