--- a/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py Tue Oct 15 22:03:54 2013 +0200 +++ b/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py Fri Oct 18 23:00:41 2013 +0200 @@ -89,6 +89,7 @@ (Queues.APPLIED_LIST, Queues.UNAPPLIED_LIST, Queues.SERIES_LIST) @param withSummary flag indicating to get a summary as well (boolean) @return list of patches (list of string) + @exception ValueError raised to indicate an invalid patch list type """ patchesList = [] @@ -117,8 +118,8 @@ if procStarted: finished = process.waitForFinished(30000) if finished and process.exitCode() == 0: - output = \ - str(process.readAllStandardOutput(), ioEncoding, 'replace') + output = str( + process.readAllStandardOutput(), ioEncoding, 'replace') for line in output.splitlines(): if withSummary: @@ -221,8 +222,8 @@ if procStarted: finished = process.waitForFinished(30000) if finished and process.exitCode() == 0: - output = \ - str(process.readAllStandardOutput(), ioEncoding, 'replace') + output = str( + process.readAllStandardOutput(), ioEncoding, 'replace') for guard in output.splitlines(): guard = guard.strip() @@ -351,9 +352,11 @@ QApplication.processEvents() self.qheaderDialog.start(name) - def hgQueuePushPopPatches(self, name, operation, all=False, named=False, force=False): + def hgQueuePushPopPatches(self, name, operation, all=False, named=False, + force=False): """ - Public method to push patches onto the stack or pop patches off the stack. + Public method to push patches onto the stack or pop patches off the + stack. @param name file/directory name (string) @param operation operation type to be performed (Queues.POP, @@ -363,6 +366,7 @@ is at the top of the stack (boolean) @keyparam force flag indicating a forceful pop (boolean) @return flag indicating that the project should be reread (boolean) + @exception ValueError raised to indicate an invalid operation """ # find the root of the repo repodir = self.vcs.splitPath(name)[0] @@ -471,7 +475,8 @@ if patchnames: currentPatch = self.__getCurrentPatch(repodir) if currentPatch: - from .HgQueuesRenamePatchDialog import HgQueuesRenamePatchDialog + from .HgQueuesRenamePatchDialog import \ + HgQueuesRenamePatchDialog dlg = HgQueuesRenamePatchDialog(currentPatch, patchnames) if dlg.exec_() == QDialog.Accepted: newName, selectedPatch = dlg.getData() @@ -499,7 +504,8 @@ args = [] args.append("qdelete") - patchnames = sorted(self.__getPatchesList(repodir, Queues.UNAPPLIED_LIST)) + patchnames = sorted(self.__getPatchesList(repodir, + Queues.UNAPPLIED_LIST)) if patchnames: patch, ok = QInputDialog.getItem( None, @@ -535,7 +541,8 @@ args = [] args.append("qfold") patchnames = sorted( - self.__getPatchesList(repodir, Queues.UNAPPLIED_LIST, withSummary=True)) + self.__getPatchesList(repodir, Queues.UNAPPLIED_LIST, + withSummary=True)) if patchnames: from .HgQueuesFoldDialog import HgQueuesFoldDialog dlg = HgQueuesFoldDialog(patchnames) @@ -577,7 +584,8 @@ self.__getPatchesList(repodir, Queues.SERIES_LIST)) if patchnames: from .HgQueuesListGuardsDialog import HgQueuesListGuardsDialog - self.queuesListGuardsDialog = HgQueuesListGuardsDialog(self.vcs, patchnames) + self.queuesListGuardsDialog = \ + HgQueuesListGuardsDialog(self.vcs, patchnames) self.queuesListGuardsDialog.show() self.queuesListGuardsDialog.start(name) else: @@ -683,7 +691,8 @@ guardsList = self.getGuardsList(repodir) if guardsList: activeGuardsList = self.getGuardsList(repodir, all=False) - from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog + from .HgQueuesGuardsSelectionDialog import \ + HgQueuesGuardsSelectionDialog dlg = HgQueuesGuardsSelectionDialog( guardsList, activeGuards=activeGuardsList, listOnly=False) if dlg.exec_() == QDialog.Accepted: @@ -740,7 +749,8 @@ guardsList = self.getGuardsList(repodir, all=False) if guardsList: - from .HgQueuesGuardsSelectionDialog import HgQueuesGuardsSelectionDialog + from .HgQueuesGuardsSelectionDialog import \ + HgQueuesGuardsSelectionDialog dlg = HgQueuesGuardsSelectionDialog(guardsList, listOnly=True) dlg.exec_() @@ -762,8 +772,10 @@ title = self.trUtf8("Create New Queue") else: title = self.trUtf8("Rename Active Queue") - from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog - dlg = HgQueuesQueueManagementDialog(HgQueuesQueueManagementDialog.NAME_INPUT, + from .HgQueuesQueueManagementDialog import \ + HgQueuesQueueManagementDialog + dlg = HgQueuesQueueManagementDialog( + HgQueuesQueueManagementDialog.NAME_INPUT, title, False, repodir, self.vcs) if dlg.exec_() == QDialog.Accepted: queueName = dlg.getData() @@ -817,6 +829,7 @@ @param name file/directory name (string) @param operation operation to be performed (Queues.QUEUE_DELETE, Queues.QUEUE_PURGE, Queues.QUEUE_ACTIVATE) + @exception ValueError raised to indicate an invalid operation """ # find the root of the repo repodir = self.vcs.splitPath(name)[0] @@ -834,8 +847,10 @@ else: raise ValueError("illegal value for operation") - from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog - dlg = HgQueuesQueueManagementDialog(HgQueuesQueueManagementDialog.QUEUE_INPUT, + from .HgQueuesQueueManagementDialog import \ + HgQueuesQueueManagementDialog + dlg = HgQueuesQueueManagementDialog( + HgQueuesQueueManagementDialog.QUEUE_INPUT, title, True, repodir, self.vcs) if dlg.exec_() == QDialog.Accepted: queueName = dlg.getData() @@ -895,7 +910,8 @@ if os.path.splitdrive(repodir)[1] == os.sep: return - from .HgQueuesQueueManagementDialog import HgQueuesQueueManagementDialog + from .HgQueuesQueueManagementDialog import \ + HgQueuesQueueManagementDialog self.queuesListQueuesDialog = HgQueuesQueueManagementDialog( HgQueuesQueueManagementDialog.NO_INPUT, self.trUtf8("Available Queues"), @@ -920,7 +936,8 @@ args.append('--mq') args.append(repodir) # init is not possible with the command server - dia = HgDialog(self.trUtf8('Initializing new queue repository'), self.vcs) + dia = HgDialog( + self.trUtf8('Initializing new queue repository'), self.vcs) res = dia.startProcess(args) if res: dia.exec_()