<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I found the culprit.<div class=""><br class=""></div><div class="">In my ~/.hgrc I activated the option:</div><div class="">[ui]</div><div class="">...</div><div class="">tweakdefaults = True </div><div class=""><br class=""></div><div class="">"tweakdefaults" changes the behaviour of mercurial to output paths relative to the current working directory instead of printing paths relative to the repository root [1].</div><div class=""><br class=""></div><div class="">I can get the same behaviour in both cases if I pass the --cwd option to mercurial.</div><div class=""><"${HG:-hg}" --config defaults.status\= --repository /Users/mhaslbeck/Projects/isabelle --cwd /Users/mhaslbeck/Projects/isabelle --noninteractive status --modified --added --clean --no-status></div><div class=""><br class=""></div><div class="">[1] <<a href="https://stackoverflow.com/a/46743585" class="">https://stackoverflow.com/a/46743585</a>> (at the end of the answer)</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">Am 02.07.2018 um 14:50 schrieb Makarius <<a href="mailto:makarius@sketis.net" class="">makarius@sketis.net</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 02/07/18 12:59, Max Haslbeck wrote:<br class=""><blockquote type="cite" class=""><br class="">When I’m in one of the "wrong" directories the build process spend most<br class="">of its time in the function Mercurial.check_files [1]. The problem seems<br class="">to be that the paths in hg.known_files() are relative to the current<br class="">working directory. So "hg.root + Path.explode(name)" returns an<br class="">incorrect path. The filtering of files in the next lines then doesn’t<br class="">work and it reruns check() for every file.<br class=""><br class="">The build process works in the directory "~/tmp/tmp" because the paths<br class="">in hg.known_files() start with "../../" and by luck "hg.root +<br class="">Path.explode(name)" returns a correct path.<br class=""><br class="">The version of my mercurial installation is 4.6.1.<br class=""><br class="">[1]<br class=""><<a href="https://isabelle.in.tum.de/repos/isabelle/file/1b9462304e1d/src/Pure/General/mercurial.scala#l156" class="">https://isabelle.in.tum.de/repos/isabelle/file/1b9462304e1d/src/Pure/General/mercurial.scala#l156</a>><br class=""></blockquote><br class="">Thanks for going to the bottom of it. Mercurial.known_files is merely a<br class="">command-line invocation as follows:<br class=""><br class="">"${HG:-hg}" --config defaults.status\= --repository<br class="">/home/makarius/isabelle/repos --noninteractive status --modified --added<br class="">--clean --no-status<br class=""><br class=""><br class="">I did not see the reported problem: the file names are always relative<br class="">to the repository root, independently of the current working directory.<br class="">I have tried it Mercurial 4.6.1 on macOS 10.13.5, and Mercurial 3.7.3 on<br class="">Ubuntu 16.04.<br class=""><br class="">So there must be something else in your setup. If we can figure this out<br class="">within the coming days or weeks, I can still do something about it for<br class="">the Isabelle2018 release.<br class=""><br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>Makarius<br class=""></div></div></blockquote></div><br class=""></div></body></html>