eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/ProjectHelper.py

changeset 7257
c4d0cac9b5c9
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7256:4ef3b78ebb4e 7257:c4d0cac9b5c9
779 779
780 def __hgQueueNewPatch(self): 780 def __hgQueueNewPatch(self):
781 """ 781 """
782 Private slot used to create a new named patch. 782 Private slot used to create a new named patch.
783 """ 783 """
784 self.vcs.getExtensionObject("mq")\ 784 self.vcs.getExtensionObject("mq").hgQueueNewPatch(
785 .hgQueueNewPatch(self.project.getProjectPath()) 785 self.project.getProjectPath())
786 786
787 def __hgQueueRefreshPatch(self): 787 def __hgQueueRefreshPatch(self):
788 """ 788 """
789 Private slot used to refresh the current patch. 789 Private slot used to refresh the current patch.
790 """ 790 """
791 self.vcs.getExtensionObject("mq")\ 791 self.vcs.getExtensionObject("mq").hgQueueRefreshPatch(
792 .hgQueueRefreshPatch(self.project.getProjectPath()) 792 self.project.getProjectPath())
793 793
794 def __hgQueueRefreshPatchMessage(self): 794 def __hgQueueRefreshPatchMessage(self):
795 """ 795 """
796 Private slot used to refresh the current patch and its commit message. 796 Private slot used to refresh the current patch and its commit message.
797 """ 797 """
798 self.vcs.getExtensionObject("mq")\ 798 self.vcs.getExtensionObject("mq").hgQueueRefreshPatch(
799 .hgQueueRefreshPatch(self.project.getProjectPath(), 799 self.project.getProjectPath(), editMessage=True)
800 editMessage=True)
801 800
802 def __hgQueueShowPatch(self): 801 def __hgQueueShowPatch(self):
803 """ 802 """
804 Private slot used to show the contents of the current patch. 803 Private slot used to show the contents of the current patch.
805 """ 804 """
806 self.vcs.getExtensionObject("mq")\ 805 self.vcs.getExtensionObject("mq").hgQueueShowPatch(
807 .hgQueueShowPatch(self.project.getProjectPath()) 806 self.project.getProjectPath())
808 807
809 def __hgQueueShowHeader(self): 808 def __hgQueueShowHeader(self):
810 """ 809 """
811 Private slot used to show the commit message of the current patch. 810 Private slot used to show the commit message of the current patch.
812 """ 811 """
813 self.vcs.getExtensionObject("mq")\ 812 self.vcs.getExtensionObject("mq").hgQueueShowHeader(
814 .hgQueueShowHeader(self.project.getProjectPath()) 813 self.project.getProjectPath())
815 814
816 def __hgQueuePushPopPatches(self, name, operation, doAll=False, 815 def __hgQueuePushPopPatches(self, name, operation, doAll=False,
817 named=False, force=False): 816 named=False, force=False):
818 """ 817 """
819 Private method to push patches onto the stack or pop patches off the 818 Private method to push patches onto the stack or pop patches off the
825 @keyparam doAll flag indicating to push/pop all (boolean) 824 @keyparam doAll flag indicating to push/pop all (boolean)
826 @keyparam named flag indicating to push/pop until a named patch 825 @keyparam named flag indicating to push/pop until a named patch
827 is at the top of the stack (boolean) 826 is at the top of the stack (boolean)
828 @keyparam force flag indicating a forceful pop (boolean) 827 @keyparam force flag indicating a forceful pop (boolean)
829 """ 828 """
830 shouldReopen = self.vcs.getExtensionObject("mq")\ 829 shouldReopen = self.vcs.getExtensionObject("mq").hgQueuePushPopPatches(
831 .hgQueuePushPopPatches(name, operation=operation, doAll=doAll, 830 name, operation=operation, doAll=doAll, named=named, force=force)
832 named=named, force=force)
833 if shouldReopen: 831 if shouldReopen:
834 res = E5MessageBox.yesNo( 832 res = E5MessageBox.yesNo(
835 None, 833 None,
836 self.tr("Changing Applied Patches"), 834 self.tr("Changing Applied Patches"),
837 self.tr("""The project should be reread. Do this now?"""), 835 self.tr("""The project should be reread. Do this now?"""),
963 961
964 def __hgQueueListPatches(self): 962 def __hgQueueListPatches(self):
965 """ 963 """
966 Private slot used to show a list of applied and unapplied patches. 964 Private slot used to show a list of applied and unapplied patches.
967 """ 965 """
968 self.vcs.getExtensionObject("mq")\ 966 self.vcs.getExtensionObject("mq").hgQueueListPatches(
969 .hgQueueListPatches(self.project.getProjectPath()) 967 self.project.getProjectPath())
970 968
971 def __hgQueueFinishAppliedPatches(self): 969 def __hgQueueFinishAppliedPatches(self):
972 """ 970 """
973 Private slot used to finish all applied patches. 971 Private slot used to finish all applied patches.
974 """ 972 """
975 self.vcs.getExtensionObject("mq")\ 973 self.vcs.getExtensionObject("mq").hgQueueFinishAppliedPatches(
976 .hgQueueFinishAppliedPatches(self.project.getProjectPath()) 974 self.project.getProjectPath())
977 975
978 def __hgQueueRenamePatch(self): 976 def __hgQueueRenamePatch(self):
979 """ 977 """
980 Private slot used to rename a patch. 978 Private slot used to rename a patch.
981 """ 979 """
982 self.vcs.getExtensionObject("mq")\ 980 self.vcs.getExtensionObject("mq").hgQueueRenamePatch(
983 .hgQueueRenamePatch(self.project.getProjectPath()) 981 self.project.getProjectPath())
984 982
985 def __hgQueueDeletePatch(self): 983 def __hgQueueDeletePatch(self):
986 """ 984 """
987 Private slot used to delete a patch. 985 Private slot used to delete a patch.
988 """ 986 """
989 self.vcs.getExtensionObject("mq")\ 987 self.vcs.getExtensionObject("mq").hgQueueDeletePatch(
990 .hgQueueDeletePatch(self.project.getProjectPath()) 988 self.project.getProjectPath())
991 989
992 def __hgQueueFoldUnappliedPatches(self): 990 def __hgQueueFoldUnappliedPatches(self):
993 """ 991 """
994 Private slot used to fold patches into the current patch. 992 Private slot used to fold patches into the current patch.
995 """ 993 """
996 self.vcs.getExtensionObject("mq")\ 994 self.vcs.getExtensionObject("mq").hgQueueFoldUnappliedPatches(
997 .hgQueueFoldUnappliedPatches(self.project.getProjectPath()) 995 self.project.getProjectPath())
998 996
999 def __hgQueueGuardsDefine(self): 997 def __hgQueueGuardsDefine(self):
1000 """ 998 """
1001 Private slot used to define guards for the current or a named patch. 999 Private slot used to define guards for the current or a named patch.
1002 """ 1000 """
1003 self.vcs.getExtensionObject("mq")\ 1001 self.vcs.getExtensionObject("mq").hgQueueGuardsDefine(
1004 .hgQueueGuardsDefine(self.project.getProjectPath()) 1002 self.project.getProjectPath())
1005 1003
1006 def __hgQueueGuardsDropAll(self): 1004 def __hgQueueGuardsDropAll(self):
1007 """ 1005 """
1008 Private slot used to drop all guards of the current or a named patch. 1006 Private slot used to drop all guards of the current or a named patch.
1009 """ 1007 """
1010 self.vcs.getExtensionObject("mq")\ 1008 self.vcs.getExtensionObject("mq").hgQueueGuardsDropAll(
1011 .hgQueueGuardsDropAll(self.project.getProjectPath()) 1009 self.project.getProjectPath())
1012 1010
1013 def __hgQueueGuardsList(self): 1011 def __hgQueueGuardsList(self):
1014 """ 1012 """
1015 Private slot used to list the guards for the current or a named patch. 1013 Private slot used to list the guards for the current or a named patch.
1016 """ 1014 """
1017 self.vcs.getExtensionObject("mq")\ 1015 self.vcs.getExtensionObject("mq").hgQueueGuardsList(
1018 .hgQueueGuardsList(self.project.getProjectPath()) 1016 self.project.getProjectPath())
1019 1017
1020 def __hgQueueGuardsListAll(self): 1018 def __hgQueueGuardsListAll(self):
1021 """ 1019 """
1022 Private slot used to list all guards of all patches. 1020 Private slot used to list all guards of all patches.
1023 """ 1021 """
1024 self.vcs.getExtensionObject("mq")\ 1022 self.vcs.getExtensionObject("mq").hgQueueGuardsListAll(
1025 .hgQueueGuardsListAll(self.project.getProjectPath()) 1023 self.project.getProjectPath())
1026 1024
1027 def __hgQueueGuardsSetActive(self): 1025 def __hgQueueGuardsSetActive(self):
1028 """ 1026 """
1029 Private slot used to set the active guards. 1027 Private slot used to set the active guards.
1030 """ 1028 """
1031 self.vcs.getExtensionObject("mq")\ 1029 self.vcs.getExtensionObject("mq").hgQueueGuardsSetActive(
1032 .hgQueueGuardsSetActive(self.project.getProjectPath()) 1030 self.project.getProjectPath())
1033 1031
1034 def __hgQueueGuardsDeactivate(self): 1032 def __hgQueueGuardsDeactivate(self):
1035 """ 1033 """
1036 Private slot used to deactivate all active guards. 1034 Private slot used to deactivate all active guards.
1037 """ 1035 """
1038 self.vcs.getExtensionObject("mq")\ 1036 self.vcs.getExtensionObject("mq").hgQueueGuardsDeactivate(
1039 .hgQueueGuardsDeactivate(self.project.getProjectPath()) 1037 self.project.getProjectPath())
1040 1038
1041 def __hgQueueGuardsIdentifyActive(self): 1039 def __hgQueueGuardsIdentifyActive(self):
1042 """ 1040 """
1043 Private slot used to list all active guards. 1041 Private slot used to list all active guards.
1044 """ 1042 """
1045 self.vcs.getExtensionObject("mq")\ 1043 self.vcs.getExtensionObject("mq").hgQueueGuardsIdentifyActive(
1046 .hgQueueGuardsIdentifyActive(self.project.getProjectPath()) 1044 self.project.getProjectPath())
1047 1045
1048 def __hgQueueCreateQueue(self): 1046 def __hgQueueCreateQueue(self):
1049 """ 1047 """
1050 Private slot used to create a new queue. 1048 Private slot used to create a new queue.
1051 """ 1049 """
1052 self.vcs.getExtensionObject("mq")\ 1050 self.vcs.getExtensionObject("mq").hgQueueCreateRenameQueue(
1053 .hgQueueCreateRenameQueue(self.project.getProjectPath(), True) 1051 self.project.getProjectPath(), True)
1054 1052
1055 def __hgQueueRenameQueue(self): 1053 def __hgQueueRenameQueue(self):
1056 """ 1054 """
1057 Private slot used to rename the active queue. 1055 Private slot used to rename the active queue.
1058 """ 1056 """
1059 self.vcs.getExtensionObject("mq")\ 1057 self.vcs.getExtensionObject("mq").hgQueueCreateRenameQueue(
1060 .hgQueueCreateRenameQueue(self.project.getProjectPath(), False) 1058 self.project.getProjectPath(), False)
1061 1059
1062 def __hgQueueDeleteQueue(self): 1060 def __hgQueueDeleteQueue(self):
1063 """ 1061 """
1064 Private slot used to delete the reference to a queue. 1062 Private slot used to delete the reference to a queue.
1065 """ 1063 """
1066 self.vcs.getExtensionObject("mq")\ 1064 self.vcs.getExtensionObject("mq").hgQueueDeletePurgeActivateQueue(
1067 .hgQueueDeletePurgeActivateQueue(self.project.getProjectPath(), 1065 self.project.getProjectPath(), Queues.QUEUE_DELETE)
1068 Queues.QUEUE_DELETE)
1069 1066
1070 def __hgQueuePurgeQueue(self): 1067 def __hgQueuePurgeQueue(self):
1071 """ 1068 """
1072 Private slot used to delete the reference to a queue and remove 1069 Private slot used to delete the reference to a queue and remove
1073 the patch directory. 1070 the patch directory.
1074 """ 1071 """
1075 self.vcs.getExtensionObject("mq")\ 1072 self.vcs.getExtensionObject("mq").hgQueueDeletePurgeActivateQueue(
1076 .hgQueueDeletePurgeActivateQueue(self.project.getProjectPath(), 1073 self.project.getProjectPath(), Queues.QUEUE_PURGE)
1077 Queues.QUEUE_PURGE)
1078 1074
1079 def __hgQueueActivateQueue(self): 1075 def __hgQueueActivateQueue(self):
1080 """ 1076 """
1081 Private slot used to set the active queue. 1077 Private slot used to set the active queue.
1082 """ 1078 """
1083 self.vcs.getExtensionObject("mq")\ 1079 self.vcs.getExtensionObject("mq").hgQueueDeletePurgeActivateQueue(
1084 .hgQueueDeletePurgeActivateQueue(self.project.getProjectPath(), 1080 self.project.getProjectPath(), Queues.QUEUE_ACTIVATE)
1085 Queues.QUEUE_ACTIVATE)
1086 1081
1087 def __hgQueueListQueues(self): 1082 def __hgQueueListQueues(self):
1088 """ 1083 """
1089 Private slot used to list available queues. 1084 Private slot used to list available queues.
1090 """ 1085 """
1091 self.vcs.getExtensionObject("mq")\ 1086 self.vcs.getExtensionObject("mq").hgQueueListQueues(
1092 .hgQueueListQueues(self.project.getProjectPath()) 1087 self.project.getProjectPath())
1093 1088
1094 def __hgQueueInit(self): 1089 def __hgQueueInit(self):
1095 """ 1090 """
1096 Private slot to initialize a new queue repository. 1091 Private slot to initialize a new queue repository.
1097 """ 1092 """
1098 self.vcs.getExtensionObject("mq")\ 1093 self.vcs.getExtensionObject("mq").hgQueueInit(
1099 .hgQueueInit(self.project.getProjectPath()) 1094 self.project.getProjectPath())
1100 1095
1101 def __hgQueueCommit(self): 1096 def __hgQueueCommit(self):
1102 """ 1097 """
1103 Private slot to commit changes in the queue repository. 1098 Private slot to commit changes in the queue repository.
1104 """ 1099 """
1106 1101
1107 def __hgQueueStatus(self): 1102 def __hgQueueStatus(self):
1108 """ 1103 """
1109 Private slot to show the status of the queue repository. 1104 Private slot to show the status of the queue repository.
1110 """ 1105 """
1111 self.vcs.getExtensionObject("mq")\ 1106 self.vcs.getExtensionObject("mq").hgQueueStatus(
1112 .hgQueueStatus(self.project.getProjectPath()) 1107 self.project.getProjectPath())
1113 1108
1114 def __hgQueueSummary(self): 1109 def __hgQueueSummary(self):
1115 """ 1110 """
1116 Private slot to show a summary of the queue repository. 1111 Private slot to show a summary of the queue repository.
1117 """ 1112 """

eric ide

mercurial