# HG changeset patch # User wenzelm # Date 1520505997 -3600 # Node ID 7e223a05e6d8527c55fe65ee5f659aeaf8c35ce6 # Parent a8a3f73623e7384fbf59f94eea2b17c29c13baeb clarified notion of unknown files: ignore files outside of a Mercurial repository; diff -r a8a3f73623e7 -r 7e223a05e6d8 src/Pure/General/mercurial.scala --- a/src/Pure/General/mercurial.scala Thu Mar 08 11:20:45 2018 +0100 +++ b/src/Pure/General/mercurial.scala Thu Mar 08 11:46:37 2018 +0100 @@ -151,10 +151,11 @@ } - /* unknown files */ + /* check files */ - def unknown_files(files: List[Path], ssh: SSH.System = SSH.Local): List[Path] = + def check_files(files: List[Path], ssh: SSH.System = SSH.Local): (List[Path], List[Path]) = { + val outside = new mutable.ListBuffer[Path] val unknown = new mutable.ListBuffer[Path] @tailrec def check(paths: List[Path]) @@ -162,7 +163,7 @@ paths match { case path :: rest => find_repository(path, ssh) match { - case None => unknown += path; check(rest) + case None => outside += path; check(rest) case Some(hg) => val known = hg.known_files().iterator.map(name => @@ -175,6 +176,6 @@ } check(files) - unknown.toList + (outside.toList, unknown.toList) } } diff -r a8a3f73623e7 -r 7e223a05e6d8 src/Pure/Tools/build.scala --- a/src/Pure/Tools/build.scala Thu Mar 08 11:20:45 2018 +0100 +++ b/src/Pure/Tools/build.scala Thu Mar 08 11:46:37 2018 +0100 @@ -438,10 +438,10 @@ } yield path).toList val exclude_files = List(Path.explode("$POLYML_EXE")).map(_.canonical_file) val unknown_files = - Mercurial.unknown_files(source_files). + Mercurial.check_files(source_files)._2. filterNot(path => exclude_files.contains(path.canonical_file)) if (unknown_files.nonEmpty) { - progress.echo_warning("Unknown files (not part of a Mercurial repository):" + + progress.echo_warning("Unknown files (not part of the underlying Mercurial repository):" + unknown_files.map(path => path.expand.implode).sorted.mkString("\n ", "\n ", "")) } }