/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to commit.py

  • Committer: Vincent Ladeuil
  • Date: 2009-05-27 19:19:25 UTC
  • mto: This revision was merged to the branch mainline in revision 640.
  • Revision ID: v.ladeuil+lp@free.fr-20090527191925-rzdpx5wnh8o1tzzm
Start testing patch behavior.

* tests/test_commit.py:
(TestUncommitHook): Start capturing actual behavior with a bzr
patched with Anne's SavedCommitMessagesManager defined in bzrlib.

* commit.py:
(CommitDialog._do_cancel): Reduce duplication.

Show diffs side-by-side

added added

removed removed

Lines of Context:
687
687
    def _do_cancel(self):
688
688
        """If requested, saves commit messages when cancelling gcommit; they are re-used by a next gcommit"""
689
689
        if can_save_commit_messages:
690
 
            self._saved_commit_messages_manager = SavedCommitMessagesManager()
691
 
            self._saved_commit_messages_manager.insert(self._get_global_commit_message(),
692
 
                                                       self._get_specific_files()[1])
693
 
            if self._saved_commit_messages_manager.is_not_empty(): # maybe worth saving
694
 
                response = question_dialog(_i18n('Commit cancelled'),
695
 
                                           _i18n('Do you want to save your commit messages ?'),
696
 
                                           parent=self)
 
690
            mgr = SavedCommitMessagesManager()
 
691
            self._saved_commit_messages_manager = mgr
 
692
            mgr.insert(self._get_global_commit_message(),
 
693
                       self._get_specific_files()[1])
 
694
            if mgr.is_not_empty(): # maybe worth saving
 
695
                response = question_dialog(
 
696
                    _i18n('Commit cancelled'),
 
697
                    _i18n('Do you want to save your commit messages ?'),
 
698
                    parent=self)
697
699
                if response == gtk.RESPONSE_NO:
698
700
                     # save nothing and destroy old comments if any
699
 
                    self._saved_commit_messages_manager = SavedCommitMessagesManager()
700
 
            self._saved_commit_messages_manager.save(self._wt, self._wt.branch)
 
701
                    mgr = SavedCommitMessagesManager()
 
702
            mgr.save(self._wt, self._wt.branch)
701
703
        self.response(gtk.RESPONSE_CANCEL) # close window
702
704
 
703
705
    @show_bzr_error