479 """ |
480 """ |
480 if not noDialog and not message: |
481 if not noDialog and not message: |
481 # call CommitDialog and get message from there |
482 # call CommitDialog and get message from there |
482 if self.__commitDialog is None: |
483 if self.__commitDialog is None: |
483 from .SvnCommitDialog import SvnCommitDialog |
484 from .SvnCommitDialog import SvnCommitDialog |
484 self.__commitDialog = SvnCommitDialog( |
485 self.__commitDialog = SvnCommitDialog(self, self.__ui) |
485 self.svnGetChangelists(), self.__ui) |
|
486 self.__commitDialog.accepted.connect(self.__vcsCommit_Step2) |
486 self.__commitDialog.accepted.connect(self.__vcsCommit_Step2) |
487 self.__commitDialog.show() |
487 self.__commitDialog.show() |
488 self.__commitDialog.raise_() |
488 self.__commitDialog.raise_() |
489 self.__commitDialog.activateWindow() |
489 self.__commitDialog.activateWindow() |
490 |
490 |
604 dlg.finish() |
604 dlg.finish() |
605 dlg.exec() |
605 dlg.exec() |
606 os.chdir(cwd) |
606 os.chdir(cwd) |
607 self.committed.emit() |
607 self.committed.emit() |
608 self.checkVCSStatus() |
608 self.checkVCSStatus() |
609 |
609 |
|
610 def vcsCommitMessages(self): |
|
611 """ |
|
612 Public method to get the list of saved commit messages. |
|
613 |
|
614 @return list of saved commit messages |
|
615 @rtype list of str |
|
616 """ |
|
617 # try per project commit history first |
|
618 messages = self._vcsProjectCommitMessages() |
|
619 if not messages: |
|
620 # empty list returned, try the vcs specific one |
|
621 messages = self.getPlugin().getPreferences("Commits") |
|
622 |
|
623 return messages |
|
624 |
|
625 def vcsAddCommitMessage(self, message): |
|
626 """ |
|
627 Public method to add a commit message to the list of saved messages. |
|
628 |
|
629 @param message message to be added |
|
630 @type str |
|
631 """ |
|
632 if not self._vcsAddProjectCommitMessage(message): |
|
633 commitMessages = self.vcsCommitMessages() |
|
634 if message in commitMessages: |
|
635 commitMessages.remove(message) |
|
636 commitMessages.insert(0, message) |
|
637 no = Preferences.getVCS("CommitMessages") |
|
638 del commitMessages[no:] |
|
639 self.getPlugin().setPreferences("Commits", commitMessages) |
|
640 |
|
641 def vcsClearCommitMessages(self): |
|
642 """ |
|
643 Public method to clear the list of saved messages. |
|
644 """ |
|
645 if not self._vcsClearProjectCommitMessages(): |
|
646 self.getPlugin().setPreferences('Commits', []) |
|
647 |
610 def vcsUpdate(self, name, noDialog=False): |
648 def vcsUpdate(self, name, noDialog=False): |
611 """ |
649 """ |
612 Public method used to update a file/directory with the Subversion |
650 Public method used to update a file/directory with the Subversion |
613 repository. |
651 repository. |
614 |
652 |