/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: 2008-09-29 16:10:51 UTC
  • Revision ID: v.ladeuil+lp@free.fr-20080929161051-pn1akd7ja5eiviwk
Fix gtk dialogs popping up and asking for input during selftest.

* tests/test_commit.py:
(TestCommitDialog_Commit._set_question_yes,
TestCommitDialog_Commit._set_question_no): Accept keyword
arguments (but ignore them).
(TestCommitDialog_Commit.test_commit_empty_message): Rename the
test to avoid confusion with test_commit_no_messages.

* commit.py:
(CommitDialog.__init__): Restore the ability to override the
dialog used for automated tests.
(CommitDialog._do_commit, CommitDialog._do_commit,
CommitDialog._do_commit): Use the dialog class defined at
construction time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
        gtk.Dialog.__init__(self, title="Commit to %s" % wt.basedir,
105
105
                                  parent=parent,
106
106
                                  flags=0,
107
 
                                  buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
 
107
                                  buttons=(gtk.STOCK_CANCEL,
 
108
                                           gtk.RESPONSE_CANCEL))
 
109
        self._question_dialog = question_dialog
108
110
 
109
111
        self._wt = wt
110
112
        # TODO: Do something with this value, it is used by Olive
650
652
        message = self._get_global_commit_message()
651
653
 
652
654
        if message == '':
653
 
            response = question_dialog(
 
655
            response = self._question_dialog(
654
656
                _i18n('Commit with an empty message?'),
655
657
                _i18n('You can describe your commit intent in the message.'),
656
658
                parent=self)
671
673
        #       entirely, since there isn't a way for them to add the unknown
672
674
        #       files at this point.
673
675
        for path in self._wt.unknowns():
674
 
            response = question_dialog(
 
676
            response = self._question_dialog(
675
677
                _i18n("Commit with unknowns?"),
676
678
                _i18n("Unknown files exist in the working tree. Commit anyway?"),
677
679
                parent=self)
692
694
                       specific_files=specific_files,
693
695
                       revprops=revprops)
694
696
        except errors.PointlessCommit:
695
 
            response = question_dialog(
 
697
            response = self._question_dialog(
696
698
                _i18n('Commit with no changes?'),
697
699
                _i18n('There are no changes in the working tree.'
698
700
                      ' Do you want to commit anyway?'),