eugene@828: #!/usr/bin/env python eugene@828: ## eugene@828: ## Copyright 2000-2014 JetBrains eugene@828: ## eugene@828: ## Licensed under the Apache License, Version 2.0 (the "License"); eugene@828: ## you may not use this file except in compliance with the License. eugene@828: ## You may obtain a copy of the License at eugene@828: ## eugene@828: ## http://www.apache.org/licenses/LICENSE-2.0 eugene@828: ## eugene@828: ## Unless required by applicable law or agreed to in writing, software eugene@828: ## distributed under the License is distributed on an "AS IS" BASIS, eugene@828: ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. eugene@828: ## See the License for the specific language governing permissions and eugene@828: ## limitations under the License. eugene@828: ## eugene@828: ## eugene@828: ## http://www.gnu.org/licenses/gpl-faq.html#GPLModuleLicense eugene@828: ## http://www.gnu.org/licenses/license-list.html#apache2 eugene@828: ## http://en.wikipedia.org/wiki/Apache_License#GPL_compatibility eugene@828: ## eugene@828: ## eugene@828: """ eugene@828: load-commands-command eugene@828: """ eugene@828: eugene@828: import codecs eugene@828: from mercurial import dispatch eugene@830: from mercurial import commands eugene@828: eugene@828: def loadArguments(ui, params_file): eugene@828: file_commands = [] eugene@828: with codecs.open(params_file, "r", "utf-8") as f: eugene@828: for _line in f: eugene@828: line = _line.strip() eugene@828: if len(line) <= 0: eugene@828: continue eugene@828: eugene@919: file_commands.append(line.encode("utf-8")) eugene@828: return file_commands eugene@828: eugene@828: eugene@830: def load_commands_command(ui, params_file, *params): eugene@828: command_arguments = loadArguments(ui, params_file) eugene@828: return dispatch.dispatch(dispatch.request(command_arguments)) eugene@828: eugene@828: #so here goes command registration and options eugene@828: cmdtable = { victory@1044: b"CMD": (load_commands_command, [], b" OUTPUT_FILE") eugene@828: } eugene@828: victory@1045: load_commands_command.norepo = True victory@1045: load_commands_command.optionalrepo = False victory@1045: load_commands_command.inferrepo = False eugene@830: eugene@828: testedwith = '2.2.2' dmitry@971: buglink = "upsource-support@jetbrains.com" eugene@828: