def _get_file_list(working_dir, status="?"): retcode, stdout = util.run_in_directory(working_dir, ["svn", "status"]) status_lines = stdout.read().split("\n") file_list = [] for line in status_lines: m = _status_line_mask.match(line) if not m: continue if m.group(1) == status: filename = m.group(2) if not filename.startswith("."): file_list.append(m.group(2)) return file_list
def run_command(command, context): command_line = command.get_command_line() # in some cases, such as Subversion's version of the # generic "commit", which is supposed to commit locally, # the command itself runs no vcs commands. if not command_line: return command.get_output() log.debug("Running: %s", (command_line,)) log.debug("Working dir: %s", context.working_dir) returncode, stdout = run_in_directory(context.working_dir, command_line) if returncode == 0 and hasattr(command, "command_successful"): command.command_successful() output = command.process_output(returncode, stdout) log.debug("Command output: %s", output) return output