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

branch
maintenance
changeset 8043
0acf98cd089a
parent 7924
8a96736d465e
parent 7971
ff2971513d6d
child 8273
698ae46f40a4
equal deleted inserted replaced
7991:866adc8c315b 8043:0acf98cd089a
778 778
779 def __hgQueueNewPatch(self): 779 def __hgQueueNewPatch(self):
780 """ 780 """
781 Private slot used to create a new named patch. 781 Private slot used to create a new named patch.
782 """ 782 """
783 self.vcs.getExtensionObject("mq").hgQueueNewPatch( 783 self.vcs.getExtensionObject("mq").hgQueueNewPatch()
784 self.project.getProjectPath())
785 784
786 def __hgQueueRefreshPatch(self): 785 def __hgQueueRefreshPatch(self):
787 """ 786 """
788 Private slot used to refresh the current patch. 787 Private slot used to refresh the current patch.
789 """ 788 """
790 self.vcs.getExtensionObject("mq").hgQueueRefreshPatch( 789 self.vcs.getExtensionObject("mq").hgQueueRefreshPatch()
791 self.project.getProjectPath())
792 790
793 def __hgQueueRefreshPatchMessage(self): 791 def __hgQueueRefreshPatchMessage(self):
794 """ 792 """
795 Private slot used to refresh the current patch and its commit message. 793 Private slot used to refresh the current patch and its commit message.
796 """ 794 """
797 self.vcs.getExtensionObject("mq").hgQueueRefreshPatch( 795 self.vcs.getExtensionObject("mq").hgQueueRefreshPatch(editMessage=True)
798 self.project.getProjectPath(), editMessage=True)
799 796
800 def __hgQueueShowPatch(self): 797 def __hgQueueShowPatch(self):
801 """ 798 """
802 Private slot used to show the contents of the current patch. 799 Private slot used to show the contents of the current patch.
803 """ 800 """
806 803
807 def __hgQueueShowHeader(self): 804 def __hgQueueShowHeader(self):
808 """ 805 """
809 Private slot used to show the commit message of the current patch. 806 Private slot used to show the commit message of the current patch.
810 """ 807 """
811 self.vcs.getExtensionObject("mq").hgQueueShowHeader( 808 self.vcs.getExtensionObject("mq").hgQueueShowHeader()
812 self.project.getProjectPath()) 809
813 810 def __hgQueuePushPopPatches(self, operation, doAll=False,
814 def __hgQueuePushPopPatches(self, name, operation, doAll=False,
815 named=False, force=False): 811 named=False, force=False):
816 """ 812 """
817 Private method to push patches onto the stack or pop patches off the 813 Private method to push patches onto the stack or pop patches off the
818 stack. 814 stack.
819 815
820 @param name file/directory name (string)
821 @param operation operation type to be performed (Queues.POP, 816 @param operation operation type to be performed (Queues.POP,
822 Queues.PUSH, Queues.GOTO) 817 Queues.PUSH, Queues.GOTO)
823 @keyparam doAll flag indicating to push/pop all (boolean) 818 @param doAll flag indicating to push/pop all (boolean)
824 @keyparam named flag indicating to push/pop until a named patch 819 @param named flag indicating to push/pop until a named patch
825 is at the top of the stack (boolean) 820 is at the top of the stack (boolean)
826 @keyparam force flag indicating a forceful pop (boolean) 821 @param force flag indicating a forceful pop (boolean)
827 """ 822 """
828 shouldReopen = self.vcs.getExtensionObject("mq").hgQueuePushPopPatches( 823 shouldReopen = self.vcs.getExtensionObject("mq").hgQueuePushPopPatches(
829 name, operation=operation, doAll=doAll, named=named, force=force) 824 operation=operation, doAll=doAll, named=named, force=force)
830 if shouldReopen: 825 if shouldReopen:
831 res = E5MessageBox.yesNo( 826 res = E5MessageBox.yesNo(
832 None, 827 None,
833 self.tr("Changing Applied Patches"), 828 self.tr("Changing Applied Patches"),
834 self.tr("""The project should be reread. Do this now?"""), 829 self.tr("""The project should be reread. Do this now?"""),
839 def __hgQueuePushPatch(self): 834 def __hgQueuePushPatch(self):
840 """ 835 """
841 Private slot used to push the next patch onto the stack. 836 Private slot used to push the next patch onto the stack.
842 """ 837 """
843 self.__hgQueuePushPopPatches( 838 self.__hgQueuePushPopPatches(
844 self.project.getProjectPath(),
845 operation=Queues.PUSH, doAll=False, named=False) 839 operation=Queues.PUSH, doAll=False, named=False)
846 840
847 def __hgQueuePushPatchForced(self): 841 def __hgQueuePushPatchForced(self):
848 """ 842 """
849 Private slot used to push the next patch onto the stack on top 843 Private slot used to push the next patch onto the stack on top
850 of local changes. 844 of local changes.
851 """ 845 """
852 self.__hgQueuePushPopPatches( 846 self.__hgQueuePushPopPatches(
853 self.project.getProjectPath(),
854 operation=Queues.PUSH, doAll=False, named=False, force=True) 847 operation=Queues.PUSH, doAll=False, named=False, force=True)
855 848
856 def __hgQueuePushAllPatches(self): 849 def __hgQueuePushAllPatches(self):
857 """ 850 """
858 Private slot used to push all patches onto the stack. 851 Private slot used to push all patches onto the stack.
859 """ 852 """
860 self.__hgQueuePushPopPatches( 853 self.__hgQueuePushPopPatches(
861 self.project.getProjectPath(),
862 operation=Queues.PUSH, doAll=True, named=False) 854 operation=Queues.PUSH, doAll=True, named=False)
863 855
864 def __hgQueuePushAllPatchesForced(self): 856 def __hgQueuePushAllPatchesForced(self):
865 """ 857 """
866 Private slot used to push all patches onto the stack on top 858 Private slot used to push all patches onto the stack on top
867 of local changes. 859 of local changes.
868 """ 860 """
869 self.__hgQueuePushPopPatches( 861 self.__hgQueuePushPopPatches(
870 self.project.getProjectPath(),
871 operation=Queues.PUSH, doAll=True, named=False, force=True) 862 operation=Queues.PUSH, doAll=True, named=False, force=True)
872 863
873 def __hgQueuePushPatches(self): 864 def __hgQueuePushPatches(self):
874 """ 865 """
875 Private slot used to push patches onto the stack until a named 866 Private slot used to push patches onto the stack until a named
876 one is at the top. 867 one is at the top.
877 """ 868 """
878 self.__hgQueuePushPopPatches( 869 self.__hgQueuePushPopPatches(
879 self.project.getProjectPath(),
880 operation=Queues.PUSH, doAll=False, named=True) 870 operation=Queues.PUSH, doAll=False, named=True)
881 871
882 def __hgQueuePushPatchesForced(self): 872 def __hgQueuePushPatchesForced(self):
883 """ 873 """
884 Private slot used to push patches onto the stack until a named 874 Private slot used to push patches onto the stack until a named
885 one is at the top on top of local changes. 875 one is at the top on top of local changes.
886 """ 876 """
887 self.__hgQueuePushPopPatches( 877 self.__hgQueuePushPopPatches(
888 self.project.getProjectPath(),
889 operation=Queues.PUSH, doAll=False, named=True, force=True) 878 operation=Queues.PUSH, doAll=False, named=True, force=True)
890 879
891 def __hgQueuePopPatch(self): 880 def __hgQueuePopPatch(self):
892 """ 881 """
893 Private slot used to pop the current patch off the stack. 882 Private slot used to pop the current patch off the stack.
894 """ 883 """
895 self.__hgQueuePushPopPatches( 884 self.__hgQueuePushPopPatches(
896 self.project.getProjectPath(),
897 operation=Queues.POP, doAll=False, named=False) 885 operation=Queues.POP, doAll=False, named=False)
898 886
899 def __hgQueuePopPatchForced(self): 887 def __hgQueuePopPatchForced(self):
900 """ 888 """
901 Private slot used to pop the current patch off the stack forgetting 889 Private slot used to pop the current patch off the stack forgetting
902 any local changes to patched files. 890 any local changes to patched files.
903 """ 891 """
904 self.__hgQueuePushPopPatches( 892 self.__hgQueuePushPopPatches(
905 self.project.getProjectPath(),
906 operation=Queues.POP, doAll=False, named=False, force=True) 893 operation=Queues.POP, doAll=False, named=False, force=True)
907 894
908 def __hgQueuePopAllPatches(self): 895 def __hgQueuePopAllPatches(self):
909 """ 896 """
910 Private slot used to pop all patches off the stack. 897 Private slot used to pop all patches off the stack.
911 """ 898 """
912 self.__hgQueuePushPopPatches( 899 self.__hgQueuePushPopPatches(
913 self.project.getProjectPath(),
914 operation=Queues.POP, doAll=True, named=False) 900 operation=Queues.POP, doAll=True, named=False)
915 901
916 def __hgQueuePopAllPatchesForced(self): 902 def __hgQueuePopAllPatchesForced(self):
917 """ 903 """
918 Private slot used to pop all patches off the stack forgetting 904 Private slot used to pop all patches off the stack forgetting
919 any local changes to patched files. 905 any local changes to patched files.
920 """ 906 """
921 self.__hgQueuePushPopPatches( 907 self.__hgQueuePushPopPatches(
922 self.project.getProjectPath(),
923 operation=Queues.POP, doAll=True, named=False, force=True) 908 operation=Queues.POP, doAll=True, named=False, force=True)
924 909
925 def __hgQueuePopPatches(self): 910 def __hgQueuePopPatches(self):
926 """ 911 """
927 Private slot used to pop patches off the stack until a named 912 Private slot used to pop patches off the stack until a named
928 one is at the top. 913 one is at the top.
929 """ 914 """
930 self.__hgQueuePushPopPatches( 915 self.__hgQueuePushPopPatches(
931 self.project.getProjectPath(),
932 operation=Queues.POP, doAll=False, named=True) 916 operation=Queues.POP, doAll=False, named=True)
933 917
934 def __hgQueuePopPatchesForced(self): 918 def __hgQueuePopPatchesForced(self):
935 """ 919 """
936 Private slot used to pop patches off the stack until a named 920 Private slot used to pop patches off the stack until a named
937 one is at the top forgetting any local changes to patched files. 921 one is at the top forgetting any local changes to patched files.
938 """ 922 """
939 self.__hgQueuePushPopPatches( 923 self.__hgQueuePushPopPatches(
940 self.project.getProjectPath(),
941 operation=Queues.POP, doAll=False, named=True, force=True) 924 operation=Queues.POP, doAll=False, named=True, force=True)
942 925
943 def __hgQueueGotoPatch(self): 926 def __hgQueueGotoPatch(self):
944 """ 927 """
945 Private slot used to push or pop patches until the a named one 928 Private slot used to push or pop patches until the a named one
946 is at the top of the stack. 929 is at the top of the stack.
947 """ 930 """
948 self.__hgQueuePushPopPatches( 931 self.__hgQueuePushPopPatches(
949 self.project.getProjectPath(),
950 operation=Queues.GOTO, doAll=False, named=True) 932 operation=Queues.GOTO, doAll=False, named=True)
951 933
952 def __hgQueueGotoPatchForced(self): 934 def __hgQueueGotoPatchForced(self):
953 """ 935 """
954 Private slot used to push or pop patches until the a named one 936 Private slot used to push or pop patches until the a named one
955 is at the top of the stack overwriting local changes. 937 is at the top of the stack overwriting local changes.
956 """ 938 """
957 self.__hgQueuePushPopPatches( 939 self.__hgQueuePushPopPatches(
958 self.project.getProjectPath(),
959 operation=Queues.GOTO, doAll=False, named=True, force=True) 940 operation=Queues.GOTO, doAll=False, named=True, force=True)
960 941
961 def __hgQueueListPatches(self): 942 def __hgQueueListPatches(self):
962 """ 943 """
963 Private slot used to show a list of applied and unapplied patches. 944 Private slot used to show a list of applied and unapplied patches.
964 """ 945 """
965 self.vcs.getExtensionObject("mq").hgQueueListPatches( 946 self.vcs.getExtensionObject("mq").hgQueueListPatches()
966 self.project.getProjectPath())
967 947
968 def __hgQueueFinishAppliedPatches(self): 948 def __hgQueueFinishAppliedPatches(self):
969 """ 949 """
970 Private slot used to finish all applied patches. 950 Private slot used to finish all applied patches.
971 """ 951 """
972 self.vcs.getExtensionObject("mq").hgQueueFinishAppliedPatches( 952 self.vcs.getExtensionObject("mq").hgQueueFinishAppliedPatches()
973 self.project.getProjectPath())
974 953
975 def __hgQueueRenamePatch(self): 954 def __hgQueueRenamePatch(self):
976 """ 955 """
977 Private slot used to rename a patch. 956 Private slot used to rename a patch.
978 """ 957 """
979 self.vcs.getExtensionObject("mq").hgQueueRenamePatch( 958 self.vcs.getExtensionObject("mq").hgQueueRenamePatch()
980 self.project.getProjectPath())
981 959
982 def __hgQueueDeletePatch(self): 960 def __hgQueueDeletePatch(self):
983 """ 961 """
984 Private slot used to delete a patch. 962 Private slot used to delete a patch.
985 """ 963 """
986 self.vcs.getExtensionObject("mq").hgQueueDeletePatch( 964 self.vcs.getExtensionObject("mq").hgQueueDeletePatch()
987 self.project.getProjectPath())
988 965
989 def __hgQueueFoldUnappliedPatches(self): 966 def __hgQueueFoldUnappliedPatches(self):
990 """ 967 """
991 Private slot used to fold patches into the current patch. 968 Private slot used to fold patches into the current patch.
992 """ 969 """
993 self.vcs.getExtensionObject("mq").hgQueueFoldUnappliedPatches( 970 self.vcs.getExtensionObject("mq").hgQueueFoldUnappliedPatches()
994 self.project.getProjectPath())
995 971
996 def __hgQueueGuardsDefine(self): 972 def __hgQueueGuardsDefine(self):
997 """ 973 """
998 Private slot used to define guards for the current or a named patch. 974 Private slot used to define guards for the current or a named patch.
999 """ 975 """
1000 self.vcs.getExtensionObject("mq").hgQueueGuardsDefine( 976 self.vcs.getExtensionObject("mq").hgQueueGuardsDefine()
1001 self.project.getProjectPath())
1002 977
1003 def __hgQueueGuardsDropAll(self): 978 def __hgQueueGuardsDropAll(self):
1004 """ 979 """
1005 Private slot used to drop all guards of the current or a named patch. 980 Private slot used to drop all guards of the current or a named patch.
1006 """ 981 """
1007 self.vcs.getExtensionObject("mq").hgQueueGuardsDropAll( 982 self.vcs.getExtensionObject("mq").hgQueueGuardsDropAll()
1008 self.project.getProjectPath())
1009 983
1010 def __hgQueueGuardsList(self): 984 def __hgQueueGuardsList(self):
1011 """ 985 """
1012 Private slot used to list the guards for the current or a named patch. 986 Private slot used to list the guards for the current or a named patch.
1013 """ 987 """
1014 self.vcs.getExtensionObject("mq").hgQueueGuardsList( 988 self.vcs.getExtensionObject("mq").hgQueueGuardsList()
1015 self.project.getProjectPath())
1016 989
1017 def __hgQueueGuardsListAll(self): 990 def __hgQueueGuardsListAll(self):
1018 """ 991 """
1019 Private slot used to list all guards of all patches. 992 Private slot used to list all guards of all patches.
1020 """ 993 """
1021 self.vcs.getExtensionObject("mq").hgQueueGuardsListAll( 994 self.vcs.getExtensionObject("mq").hgQueueGuardsListAll()
1022 self.project.getProjectPath())
1023 995
1024 def __hgQueueGuardsSetActive(self): 996 def __hgQueueGuardsSetActive(self):
1025 """ 997 """
1026 Private slot used to set the active guards. 998 Private slot used to set the active guards.
1027 """ 999 """
1028 self.vcs.getExtensionObject("mq").hgQueueGuardsSetActive( 1000 self.vcs.getExtensionObject("mq").hgQueueGuardsSetActive()
1029 self.project.getProjectPath())
1030 1001
1031 def __hgQueueGuardsDeactivate(self): 1002 def __hgQueueGuardsDeactivate(self):
1032 """ 1003 """
1033 Private slot used to deactivate all active guards. 1004 Private slot used to deactivate all active guards.
1034 """ 1005 """
1035 self.vcs.getExtensionObject("mq").hgQueueGuardsDeactivate( 1006 self.vcs.getExtensionObject("mq").hgQueueGuardsDeactivate()
1036 self.project.getProjectPath())
1037 1007
1038 def __hgQueueGuardsIdentifyActive(self): 1008 def __hgQueueGuardsIdentifyActive(self):
1039 """ 1009 """
1040 Private slot used to list all active guards. 1010 Private slot used to list all active guards.
1041 """ 1011 """
1042 self.vcs.getExtensionObject("mq").hgQueueGuardsIdentifyActive( 1012 self.vcs.getExtensionObject("mq").hgQueueGuardsIdentifyActive()
1043 self.project.getProjectPath())
1044 1013
1045 def __hgQueueCreateQueue(self): 1014 def __hgQueueCreateQueue(self):
1046 """ 1015 """
1047 Private slot used to create a new queue. 1016 Private slot used to create a new queue.
1048 """ 1017 """
1049 self.vcs.getExtensionObject("mq").hgQueueCreateRenameQueue( 1018 self.vcs.getExtensionObject("mq").hgQueueCreateRenameQueue(True)
1050 self.project.getProjectPath(), True)
1051 1019
1052 def __hgQueueRenameQueue(self): 1020 def __hgQueueRenameQueue(self):
1053 """ 1021 """
1054 Private slot used to rename the active queue. 1022 Private slot used to rename the active queue.
1055 """ 1023 """
1056 self.vcs.getExtensionObject("mq").hgQueueCreateRenameQueue( 1024 self.vcs.getExtensionObject("mq").hgQueueCreateRenameQueue(False)
1057 self.project.getProjectPath(), False)
1058 1025
1059 def __hgQueueDeleteQueue(self): 1026 def __hgQueueDeleteQueue(self):
1060 """ 1027 """
1061 Private slot used to delete the reference to a queue. 1028 Private slot used to delete the reference to a queue.
1062 """ 1029 """
1063 self.vcs.getExtensionObject("mq").hgQueueDeletePurgeActivateQueue( 1030 self.vcs.getExtensionObject("mq").hgQueueDeletePurgeActivateQueue(
1064 self.project.getProjectPath(), Queues.QUEUE_DELETE) 1031 Queues.QUEUE_DELETE)
1065 1032
1066 def __hgQueuePurgeQueue(self): 1033 def __hgQueuePurgeQueue(self):
1067 """ 1034 """
1068 Private slot used to delete the reference to a queue and remove 1035 Private slot used to delete the reference to a queue and remove
1069 the patch directory. 1036 the patch directory.
1070 """ 1037 """
1071 self.vcs.getExtensionObject("mq").hgQueueDeletePurgeActivateQueue( 1038 self.vcs.getExtensionObject("mq").hgQueueDeletePurgeActivateQueue(
1072 self.project.getProjectPath(), Queues.QUEUE_PURGE) 1039 Queues.QUEUE_PURGE)
1073 1040
1074 def __hgQueueActivateQueue(self): 1041 def __hgQueueActivateQueue(self):
1075 """ 1042 """
1076 Private slot used to set the active queue. 1043 Private slot used to set the active queue.
1077 """ 1044 """
1078 self.vcs.getExtensionObject("mq").hgQueueDeletePurgeActivateQueue( 1045 self.vcs.getExtensionObject("mq").hgQueueDeletePurgeActivateQueue(
1079 self.project.getProjectPath(), Queues.QUEUE_ACTIVATE) 1046 Queues.QUEUE_ACTIVATE)
1080 1047
1081 def __hgQueueListQueues(self): 1048 def __hgQueueListQueues(self):
1082 """ 1049 """
1083 Private slot used to list available queues. 1050 Private slot used to list available queues.
1084 """ 1051 """
1085 self.vcs.getExtensionObject("mq").hgQueueListQueues( 1052 self.vcs.getExtensionObject("mq").hgQueueListQueues()
1086 self.project.getProjectPath())
1087 1053
1088 def __hgQueueInit(self): 1054 def __hgQueueInit(self):
1089 """ 1055 """
1090 Private slot to initialize a new queue repository. 1056 Private slot to initialize a new queue repository.
1091 """ 1057 """

eric ide

mercurial