Comment 15 for bug 215674

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

Elliot and Jelmer, thank you for being so prompt to look at my work.

Jelmer :
The way I did (proposing the user to save when exiting) is quite common in applications like editors. It has the advantage of using disk space only if user chooses to save. And asking a yes-no question at exit time is not more annoying than letting the user select its comments in a drop-down list at start.
In your solution, would the drop-down list contain comments saved by all previous gcommit cancels? How many at most? In drop-down lists I have seen, there is only one line per item. What about when two saved messages differ only at their tenth line, for example? How does the user distinguish between them in the drop-down list?

Elliot: thank you for making me notice that there are tests :)
After this little change in the patch:
--- bzrlib/uncommit.py.2 2008-05-15 00:06:43.000000000 +0200
+++ bzrlib/uncommit.py 2008-05-15 00:06:06.000000000 +0200
@@ -79,6 +79,9 @@
             else:
                 file_info = bencode.bdecode(file_info.encode('UTF-8'))
             global_message = rev.message
+ if not isinstance(global_message, unicode):
+ # rev.message is sometimes unicode, sometimes str
+ global_message = global_message.decode('UTF-8')
             # Concatenate comments of all undone revisions:
             saved_commit_messages_manager.insert(global_message, file_info)
             # When we finish popping off the pending merges, we want

all tests are passing now : 'bzr self-test -v' shows the same failing tests before and after applying the patch. I'll soon attach a cumulative patch.
I haven't yet created new specific tests for this patch. I propose to add tests after there is a consensus between you, Jelmer and me on the above design points regarding gcommit.