public HgExe(MercurialSCM scm, Launcher launcher, Node node, TaskListener listener, EnvVars env) throws IOException, InterruptedException { base = scm.findHgExe(node, listener, true); this.node = node; this.env = env; this.launcher = launcher; this.listener = listener; this.capability = Capability.get(this); }
/** Runs the command and captures the output. */ public String popen( FilePath repository, TaskListener listener, boolean useTimeout, ArgumentListBuilder args) throws IOException, InterruptedException { args = seed().add(args.toCommandArray()); ByteArrayOutputStream rev = new ByteArrayOutputStream(); if (MercurialSCM.joinWithPossibleTimeout( l(args).pwd(repository).stdout(rev), useTimeout, listener) == 0) { return rev.toString(); } else { listener.error("Failed to run " + args.toStringWithQuote()); listener.getLogger().write(rev.toByteArray()); throw new AbortException(); } }
private ProcStarter l(ArgumentListBuilder args) { // set the default stdout return MercurialSCM.launch(launcher).cmds(args).stdout(listener).envs(env); }