def commitChanges(self, workflowDir): om = self._main_window.model().optionsManager() pmr_info = PMR() pmr_tool = PMRTool(pmr_info, use_external_git=om.getOption(USE_EXTERNAL_GIT)) if not pmr_tool.hasDVCS(workflowDir): # nothing to commit. return True return self._commitChanges(workflowDir, 'Workflow saved.')
def _setIndexerFile(self, workflow_dir): pmr_tool = PMRTool() if not pmr_tool.hasDVCS(workflow_dir): return try: pmr_tool.addFileToIndexer(workflow_dir, DEFAULT_WORKFLOW_ANNOTATION_FILENAME) # pmr_tool.commitFiles(local_workspace_dir, message, files) except ClientRuntimeError: # handler will deal with this. raise
def _setIndexerFile(self, workflow_dir): om = self._main_window.model().optionsManager() pmr_info = PMR() pmr_tool = PMRTool(pmr_info, use_external_git=om.getOption(USE_EXTERNAL_GIT)) if not pmr_tool.hasDVCS(workflow_dir): return try: pmr_tool.addFileToIndexer(workflow_dir, DEFAULT_WORKFLOW_ANNOTATION_FILENAME) # pmr_tool.commitFiles(local_workspace_dir, message, files) except ClientRuntimeError: # handler will deal with this. raise
def commitChanges(self, workflowDir): pmr_tool = PMRTool() if not pmr_tool.hasDVCS(workflowDir): # nothing to commit. return True dlg = PMRHgCommitDialog(self) dlg.setModal(True) if dlg.exec_() == QtGui.QDialog.Rejected: return False action = dlg.action() if action == QtGui.QDialogButtonBox.Ok: return True elif action == QtGui.QDialogButtonBox.Save: return self._commitChanges(workflowDir, dlg.comment(), commit_local=True) return self._commitChanges(workflowDir, dlg.comment())