basic support for Mercurial command line tools;
authorwenzelm
Tue Apr 29 15:24:41 2014 +0200 (2014-04-29)
changeset 56785df03bf8c36a1
parent 56784 776890e0cf71
child 56786 13ede133f6eb
basic support for Mercurial command line tools;
src/Pure/System/isabelle_system.scala
     1.1 --- a/src/Pure/System/isabelle_system.scala	Tue Apr 29 14:50:40 2014 +0200
     1.2 +++ b/src/Pure/System/isabelle_system.scala	Tue Apr 29 15:24:41 2014 +0200
     1.3 @@ -444,6 +444,7 @@
     1.4      def err: String = cat_lines(err_lines)
     1.5      def add_err(s: String): Bash_Result = copy(err_lines = err_lines ::: List(s))
     1.6      def set_rc(i: Int): Bash_Result = copy(rc = i)
     1.7 +    def check_error: Bash_Result = if (rc != 0) error(err) else this
     1.8    }
     1.9  
    1.10    private class Limited_Progress(proc: Managed_Process, progress_limit: Option[Long])
    1.11 @@ -514,6 +515,8 @@
    1.12    def pdf_viewer(arg: Path): Unit =
    1.13      bash("exec \"$PDF_VIEWER\" '" + standard_path(arg) + "' >/dev/null 2>/dev/null &")
    1.14  
    1.15 +  def hg(cmd_line: String, cwd: Path = Path.current): Bash_Result =
    1.16 +    bash("cd " + shell_path(cwd) + " && \"${HG:-hg}\" " + cmd_line)
    1.17  
    1.18  
    1.19    /** Isabelle resources **/