eric7/Plugins/VcsPlugins/vcsMercurial/hg.py

branch
eric7
changeset 8624
5192a2592324
parent 8621
8c9f41115c04
child 8653
43d556326ded
equal deleted inserted replaced
8623:fced5aa98d41 8624:5192a2592324
25 from VCS.RepositoryInfoDialog import VcsRepositoryInfoDialog 25 from VCS.RepositoryInfoDialog import VcsRepositoryInfoDialog
26 26
27 from .HgDialog import HgDialog 27 from .HgDialog import HgDialog
28 from .HgClient import HgClient 28 from .HgClient import HgClient
29 29
30 import Preferences
30 import Utilities 31 import Utilities
31 32
32 33
33 class Hg(VersionControl): 34 class Hg(VersionControl):
34 """ 35 """
539 model = ericApp().getObject("Project").getModel() 540 model = ericApp().getObject("Project").getModel()
540 for name in self.__forgotNames: 541 for name in self.__forgotNames:
541 model.updateVCSStatus(name) 542 model.updateVCSStatus(name)
542 self.__forgotNames = [] 543 self.__forgotNames = []
543 self.checkVCSStatus() 544 self.checkVCSStatus()
545
546 def vcsCommitMessages(self):
547 """
548 Public method to get the list of saved commit messages.
549
550 @return list of saved commit messages
551 @rtype list of str
552 """
553 # try per project commit history first
554 messages = self._vcsProjectCommitMessages()
555 if not messages:
556 # empty list returned, try the vcs specific one
557 messages = self.getPlugin().getPreferences('Commits')
558
559 return messages
560
561 def vcsAddCommitMessage(self, message):
562 """
563 Public method to add a commit message to the list of saved messages.
564
565 @param message message to be added
566 @type str
567 """
568 if not self._vcsAddProjectCommitMessage(message):
569 commitMessages = self.vcsCommitMessages()
570 if message in commitMessages:
571 commitMessages.remove(message)
572 commitMessages.insert(0, message)
573 no = Preferences.getVCS("CommitMessages")
574 del commitMessages[no:]
575 self.getPlugin().setPreferences('Commits', commitMessages)
576
577 def vcsClearCommitMessages(self):
578 """
579 Public method to clear the list of saved messages.
580 """
581 if not self._vcsClearProjectCommitMessages():
582 self.getPlugin().setPreferences('Commits', [])
544 583
545 def __getMostRecentCommitMessage(self): 584 def __getMostRecentCommitMessage(self):
546 """ 585 """
547 Private method to get the most recent commit message. 586 Private method to get the most recent commit message.
548 587

eric ide

mercurial