[MERGE/RFC] Revert reporting #307

Aaron Bentley aaron.bentley at utoronto.ca
Wed Jan 10 15:59:50 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

A long-standing bug is that revert doesn't report on the changes it makes.

This patch adds such reporting to 'revert'.

Because revert must handle a wide variety of situations, our existing
reporting methods are inadequate.
 - they have no way to represent a 'kind' change
 - they don't differentiate between 'renamed' and 'renamed and modified'.
 - they can't indicate file versioning operations separately from file
creation/deletion

This bundle adds reporting and introduces a new format, with three
columns for version-change/rename, content-change, and execute-bit change.

Some examples:

+N  dir1/
A directory was added and created

- -D  file1
A file was removed and deleted

RM* dir1/file1 => dir2/file1
A file was moved, modified, and had the execute bit changed

 K  name1 => name1/
A file was changed into a directory

Version-change and rename can share a column because a file must start
versioned and stay versioned in order for us to detect a rename.  So
'add', 'remove' and 'rename' are mutually exclusive, as long as we are
detecting changes.

This implementation reports on the differences between the working tree
and the target tree, rather than reporting on the actual changes made.

Another possible implementation would be to derive the changes from the
TreeTransform.  This would have slightly higher fidelity:
 - Its output could reflect conflict resolution outcomes
 - The same output could be produced by "merge", "checkout" and other
   TreeTransform operations.

But there are also disadvantages:
 - It would need to be able to indicate simultaneous 'add'/'remove' and
'rename'.
 - It would need to display renames due to conflict resolution in
   a reasonable way
 - Some effort is needed to implement _iter_changes on TreeTransform
 - It would report the creation of backup files

The creation of backup files is especially problematic, because we don't
technically create backups-- we rename and unversion the existing file,
then create and version a file with the desired text.  So we would get

- - R  file => file.~1~
+N   file

When what we want is really:
M    file
(note that file.~1~ isn't mentioned)

So folks, what shall we do?

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFFpQ120F+nu1YWqI0RAtVvAJ4h7x+YqKTnRZXsitXtLsxOSseOAQCfdvhf
/dpi9q4e2bFkmYETQUzvca8=
=tmsb
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: revert-reporting.patch
Type: text/x-patch
Size: 65708 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070110/935a68ba/attachment-0001.bin 


More information about the bazaar mailing list