src/eric7/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py

branch
eric7
changeset 10438
4cd7e5a8b3cf
parent 10069
435cc5875135
child 10439
21c28b0f9e41
equal deleted inserted replaced
10437:2f70ca07f0af 10438:4cd7e5a8b3cf
35 def __init__(self, vcs): 35 def __init__(self, vcs):
36 """ 36 """
37 Constructor 37 Constructor
38 38
39 @param vcs reference to the Mercurial vcs object 39 @param vcs reference to the Mercurial vcs object
40 @type Hg
40 """ 41 """
41 super().__init__(vcs) 42 super().__init__(vcs)
42 43
43 self.qdiffDialog = None 44 self.qdiffDialog = None
44 self.qheaderDialog = None 45 self.qheaderDialog = None
74 """ 75 """
75 Private method to get a list of patches of a given type. 76 Private method to get a list of patches of a given type.
76 77
77 @param listType type of patches list to get 78 @param listType type of patches list to get
78 (Queues.APPLIED_LIST, Queues.UNAPPLIED_LIST, Queues.SERIES_LIST) 79 (Queues.APPLIED_LIST, Queues.UNAPPLIED_LIST, Queues.SERIES_LIST)
79 @param withSummary flag indicating to get a summary as well (boolean) 80 @type int
80 @return list of patches (list of string) 81 @param withSummary flag indicating to get a summary as well
82 @type bool
83 @return list of patches
84 @rtype list of str
81 @exception ValueError raised to indicate an invalid patch list type 85 @exception ValueError raised to indicate an invalid patch list type
82 """ 86 """
83 patchesList = [] 87 patchesList = []
84 88
85 if listType not in ( 89 if listType not in (
117 121
118 def __getCurrentPatch(self): 122 def __getCurrentPatch(self):
119 """ 123 """
120 Private method to get the name of the current patch. 124 Private method to get the name of the current patch.
121 125
122 @return name of the current patch (string) 126 @return name of the current patch
127 @rtype str
123 """ 128 """
124 currentPatch = "" 129 currentPatch = ""
125 130
126 args = self.vcs.initCommand("qtop") 131 args = self.vcs.initCommand("qtop")
127 132
132 137
133 def __getCommitMessage(self): 138 def __getCommitMessage(self):
134 """ 139 """
135 Private method to get the commit message of the current patch. 140 Private method to get the commit message of the current patch.
136 141
137 @return name of the current patch (string) 142 @return name of the current patch
143 @rtype str
138 """ 144 """
139 message = "" 145 message = ""
140 146
141 args = self.vcs.initCommand("qheader") 147 args = self.vcs.initCommand("qheader")
142 148
147 153
148 def getGuardsList(self, allGuards=True): 154 def getGuardsList(self, allGuards=True):
149 """ 155 """
150 Public method to get a list of all guards defined. 156 Public method to get a list of all guards defined.
151 157
152 @param allGuards flag indicating to get all guards (boolean) 158 @param allGuards flag indicating to get all guards
153 @return sorted list of guards (list of strings) 159 @type bool
160 @return sorted list of guards
161 @rtype list of str
154 """ 162 """
155 guardsList = [] 163 guardsList = []
156 164
157 args = self.vcs.initCommand("qselect") 165 args = self.vcs.initCommand("qselect")
158 if allGuards: 166 if allGuards:
212 def hgQueueRefreshPatch(self, editMessage=False): 220 def hgQueueRefreshPatch(self, editMessage=False):
213 """ 221 """
214 Public method to refresh the current patch. 222 Public method to refresh the current patch.
215 223
216 @param editMessage flag indicating to edit the current 224 @param editMessage flag indicating to edit the current
217 commit message (boolean) 225 commit message
226 @type bool
218 """ 227 """
219 from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog 228 from .HgQueuesNewPatchDialog import HgQueuesNewPatchDialog
220 229
221 args = self.vcs.initCommand("qrefresh") 230 args = self.vcs.initCommand("qrefresh")
222 231
258 267
259 def hgQueueShowPatch(self, name): 268 def hgQueueShowPatch(self, name):
260 """ 269 """
261 Public method to show the contents of the current patch. 270 Public method to show the contents of the current patch.
262 271
263 @param name file/directory name (string) 272 @param name file/directory name
273 @type str
264 """ 274 """
265 from ..HgDiffDialog import HgDiffDialog 275 from ..HgDiffDialog import HgDiffDialog
266 276
267 self.qdiffDialog = HgDiffDialog(self.vcs) 277 self.qdiffDialog = HgDiffDialog(self.vcs)
268 self.qdiffDialog.show() 278 self.qdiffDialog.show()
285 Public method to push patches onto the stack or pop patches off the 295 Public method to push patches onto the stack or pop patches off the
286 stack. 296 stack.
287 297
288 @param operation operation type to be performed (Queues.POP, 298 @param operation operation type to be performed (Queues.POP,
289 Queues.PUSH, Queues.GOTO) 299 Queues.PUSH, Queues.GOTO)
290 @param doAll flag indicating to push/pop all (boolean) 300 @type int
301 @param doAll flag indicating to push/pop all
302 @type bool
291 @param named flag indicating to push/pop until a named patch 303 @param named flag indicating to push/pop until a named patch
292 is at the top of the stack (boolean) 304 is at the top of the stack
293 @param force flag indicating a forceful pop (boolean) 305 @type bool
294 @return flag indicating that the project should be reread (boolean) 306 @param force flag indicating a forceful pop
307 @type bool
308 @return flag indicating that the project should be reread
309 @rtype bool
295 @exception ValueError raised to indicate an invalid operation 310 @exception ValueError raised to indicate an invalid operation
296 """ 311 """
297 if operation not in (Queues.POP, Queues.PUSH, Queues.GOTO): 312 if operation not in (Queues.POP, Queues.PUSH, Queues.GOTO):
298 raise ValueError("illegal value for operation") 313 raise ValueError("illegal value for operation")
299 314
591 606
592 def hgQueueCreateRenameQueue(self, isCreate): 607 def hgQueueCreateRenameQueue(self, isCreate):
593 """ 608 """
594 Public method to create a new queue or rename the active queue. 609 Public method to create a new queue or rename the active queue.
595 610
596 @param isCreate flag indicating to create a new queue (boolean) 611 @param isCreate flag indicating to create a new queue
612 @type bool
597 """ 613 """
598 from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog 614 from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog
599 615
600 title = ( 616 title = (
601 self.tr("Create New Queue") if isCreate else self.tr("Rename Active Queue") 617 self.tr("Create New Queue") if isCreate else self.tr("Rename Active Queue")
636 Public method to delete the reference to a queue and optionally 652 Public method to delete the reference to a queue and optionally
637 remove the patch directory or set the active queue. 653 remove the patch directory or set the active queue.
638 654
639 @param operation operation to be performed (Queues.QUEUE_DELETE, 655 @param operation operation to be performed (Queues.QUEUE_DELETE,
640 Queues.QUEUE_PURGE, Queues.QUEUE_ACTIVATE) 656 Queues.QUEUE_PURGE, Queues.QUEUE_ACTIVATE)
657 @type int
641 @exception ValueError raised to indicate an invalid operation 658 @exception ValueError raised to indicate an invalid operation
642 """ 659 """
643 from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog 660 from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog
644 661
645 if operation not in ( 662 if operation not in (
718 735
719 def hgQueueStatus(self, name): 736 def hgQueueStatus(self, name):
720 """ 737 """
721 Public method used to view the status of a queue repository. 738 Public method used to view the status of a queue repository.
722 739
723 @param name directory name (string) 740 @param name directory name
741 @type str
724 """ 742 """
725 from ..HgStatusDialog import HgStatusDialog 743 from ..HgStatusDialog import HgStatusDialog
726 744
727 self.queueStatusDialog = HgStatusDialog(self.vcs, mq=True) 745 self.queueStatusDialog = HgStatusDialog(self.vcs, mq=True)
728 self.queueStatusDialog.show() 746 self.queueStatusDialog.show()

eric ide

mercurial