# HG changeset patch # User wenzelm # Date 1494773643 -7200 # Node ID 11f87ab51ddb36a88ca3087096597d179cf6466a # Parent 4ff79bd2b26545e121778af23e93cbdbb387f815 more robust command invocation, without defaults from hgrc; diff -r 4ff79bd2b265 -r 11f87ab51ddb src/Pure/General/mercurial.scala --- a/src/Pure/General/mercurial.scala Sun May 14 15:58:07 2017 +0200 +++ b/src/Pure/General/mercurial.scala Sun May 14 16:54:03 2017 +0200 @@ -96,7 +96,7 @@ def command(name: String, args: String = "", options: String = ""): Process_Result = { val cmdline = - "\"${HG:-hg}\"" + + "\"${HG:-hg}\" --config " + Bash.string("defaults." + name + "=") + (if (name == "clone") "" else " --repository " + File.bash_path(root)) + " --noninteractive " + name + " " + options + " " + args ssh match { @@ -139,21 +139,13 @@ } def known_files(): List[String] = - hg.command("status", options = "--modified --added --clean --no-status --color=never"). - check.out_lines - - def length(): Int = - identify(options = "-n") match { - case Value.Int(n) => n + 1 - case s => error("Cannot determine repository length from " + quote(s)) - } + hg.command("status", options = "--modified --added --clean --no-status").check.out_lines def graph(): Graph[String, Unit] = { val Node = """^node: (\w{12}) (\w{12}) (\w{12})""".r val log_result = - log(template = """node: {node|short} {p1node|short} {p2node|short}\n""", - options = "-l " + length()) + log(template = """node: {node|short} {p1node|short} {p2node|short}\n""") (Graph.string[Unit] /: split_lines(log_result)) { case (graph, Node(x, y, z)) => val deps = List(y, z).filterNot(s => s.forall(_ == '0'))