clarified notion of unknown files: ignore files outside of a Mercurial repository;
authorwenzelm
Thu Mar 08 11:46:37 2018 +0100 (14 months ago)
changeset 677827e223a05e6d8
parent 67781 a8a3f73623e7
child 67783 839de121665c
clarified notion of unknown files: ignore files outside of a Mercurial repository;
src/Pure/General/mercurial.scala
src/Pure/Tools/build.scala
     1.1 --- a/src/Pure/General/mercurial.scala	Thu Mar 08 11:20:45 2018 +0100
     1.2 +++ b/src/Pure/General/mercurial.scala	Thu Mar 08 11:46:37 2018 +0100
     1.3 @@ -151,10 +151,11 @@
     1.4    }
     1.5  
     1.6  
     1.7 -  /* unknown files */
     1.8 +  /* check files */
     1.9  
    1.10 -  def unknown_files(files: List[Path], ssh: SSH.System = SSH.Local): List[Path] =
    1.11 +  def check_files(files: List[Path], ssh: SSH.System = SSH.Local): (List[Path], List[Path]) =
    1.12    {
    1.13 +    val outside = new mutable.ListBuffer[Path]
    1.14      val unknown = new mutable.ListBuffer[Path]
    1.15  
    1.16      @tailrec def check(paths: List[Path])
    1.17 @@ -162,7 +163,7 @@
    1.18        paths match {
    1.19          case path :: rest =>
    1.20            find_repository(path, ssh) match {
    1.21 -            case None => unknown += path; check(rest)
    1.22 +            case None => outside += path; check(rest)
    1.23              case Some(hg) =>
    1.24                val known =
    1.25                  hg.known_files().iterator.map(name =>
    1.26 @@ -175,6 +176,6 @@
    1.27      }
    1.28  
    1.29      check(files)
    1.30 -    unknown.toList
    1.31 +    (outside.toList, unknown.toList)
    1.32    }
    1.33  }
     2.1 --- a/src/Pure/Tools/build.scala	Thu Mar 08 11:20:45 2018 +0100
     2.2 +++ b/src/Pure/Tools/build.scala	Thu Mar 08 11:46:37 2018 +0100
     2.3 @@ -438,10 +438,10 @@
     2.4          } yield path).toList
     2.5        val exclude_files = List(Path.explode("$POLYML_EXE")).map(_.canonical_file)
     2.6        val unknown_files =
     2.7 -        Mercurial.unknown_files(source_files).
     2.8 +        Mercurial.check_files(source_files)._2.
     2.9            filterNot(path => exclude_files.contains(path.canonical_file))
    2.10        if (unknown_files.nonEmpty) {
    2.11 -        progress.echo_warning("Unknown files (not part of a Mercurial repository):" +
    2.12 +        progress.echo_warning("Unknown files (not part of the underlying Mercurial repository):" +
    2.13            unknown_files.map(path => path.expand.implode).sorted.mkString("\n  ", "\n  ", ""))
    2.14        }
    2.15      }