src/Pure/Tools/build.scala
changeset 65832 2fb85623c386
parent 65831 3b197547c1d4
child 65935 73c099fa96a4
     1.1 --- a/src/Pure/Tools/build.scala	Sun May 14 17:19:46 2017 +0200
     1.2 +++ b/src/Pure/Tools/build.scala	Sun May 14 20:16:13 2017 +0200
     1.3 @@ -338,6 +338,7 @@
     1.4    def build(
     1.5      options: Options,
     1.6      progress: Progress = No_Progress,
     1.7 +    check_unknown_files: Boolean = false,
     1.8      build_heap: Boolean = false,
     1.9      clean_build: Boolean = false,
    1.10      dirs: List[Path] = Nil,
    1.11 @@ -377,6 +378,19 @@
    1.12      def sources_stamp(name: String): List[String] =
    1.13        (selected_sessions(name).meta_digest :: deps.sources(name)).map(_.toString).sorted
    1.14  
    1.15 +    if (check_unknown_files) {
    1.16 +      val source_files =
    1.17 +        (for {
    1.18 +          (_, base) <- deps.session_bases.iterator
    1.19 +          (path, _) <- base.sources.iterator
    1.20 +        } yield path).toList
    1.21 +      val unknown_files = Mercurial.unknown_files(source_files)
    1.22 +      if (unknown_files.nonEmpty) {
    1.23 +        progress.echo_warning("Unknown files (not part of a Mercurial repository):" +
    1.24 +          unknown_files.map(path => path.expand.implode).sorted.mkString("\n  ", "\n  ", ""))
    1.25 +      }
    1.26 +    }
    1.27 +
    1.28  
    1.29      /* main build process */
    1.30  
    1.31 @@ -680,6 +694,7 @@
    1.32      val results =
    1.33        progress.interrupt_handler {
    1.34          build(options, progress,
    1.35 +          check_unknown_files = Mercurial.is_repository(Path.explode("~~")),
    1.36            build_heap = build_heap,
    1.37            clean_build = clean_build,
    1.38            dirs = dirs,