Comment 12 for bug 215674

Revision history for this message
Anne Mohsen (anne-mohsen) wrote :

I propose the attached patch which does the following:
- when the gcommit window is terminated with the "Cancel" button or the "close" icon, if some global or per-file commit messages have been entered, it asks the user whether to save messages or not; if the user clicks "yes" it saves them; if the user clicks "no" it empties any saved messages. If the "Commit" button is pressed, it empties any saved messages.
- when "bzr uncommit" runs, it saves commit messages of the uncommitted revision. If multiple revisions are uncommitted (with the -r option), the messages are concatenated with a "\n******\n" separator line in between. So if in revision 2, file 'a' had commit message "a2" and file 'b' had "b2" and if in revision 3, 'a' had "a3" and 'b' had "b3", then "bzr uncommit -r1" saves messages "a2\n******\na3" for a and "b2\n******\nb3" for 'b'. If when "bzr uncommit" starts, it finds existing saved messages (from either a previous uncommit or cancelled gcommit), it concatenates with them (so, in the example above, running "bzr uncommit" twice produces the same saved messages as "bzr uncommit -r1").
I modified gtk/gcommit.py and bzrlib/uncommit.py. The messages are stored like qbzr does, in the branch's configuration, which is not perfect (I'm ready to move that to the working tree instead, but then I'll have questions).
The patch is against bzr revno 3405 and bzr-gtk revno 481.