<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">On 5/15/15 6:09 AM, Martin von
      Zweigbergk wrote:<br>
    </div>
    <blockquote
cite="mid:CAESOdVDf2pwXBvWBaNc5xmrDtFFCuMSZeKhAyXuS2196ombV1g@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <p dir="ltr">I agree with the other Martin. I'm not at a computer
        now, so it's hard to check, but where are the ignore patterns
        used? I know it's used while walking the working copy in
        dirstate.py. I would think that that piece of code would not
        mind if it had to create a new union matcher every time it
        visited a subdirectory mentioned in an include. Would applying
        the matcher to only the path within the subdirectory be a
        problem performance-wise?</p>
    </blockquote>
    The matcher is a bit of a hotpath (our working copies can have
    500,000+ files) and right now every match is done entirely in the
    native re2 code.  I worry that adding additional string and python
    logic to every path match would have a perf impact.  I guess I can
    hack something up to test it.<br>
    <br>
    From a simple grepping, ignores seem to only be used for
    dirstate.walk.<br>
    <blockquote
cite="mid:CAESOdVDf2pwXBvWBaNc5xmrDtFFCuMSZeKhAyXuS2196ombV1g@mail.gmail.com"
      type="cite">
      <p dir="ltr">Are the .hgignore files always read from the working
        copy? If not, it would be nice to not have to read all the
        submanifests (when using such) for operations that care only
        about some subdirectory.</p>
    </blockquote>
    From what I can tell, it's always read from the working copy.<br>
    <blockquote
cite="mid:CAESOdVDf2pwXBvWBaNc5xmrDtFFCuMSZeKhAyXuS2196ombV1g@mail.gmail.com"
      type="cite">
      <p dir="ltr">Also, does the subdirectory .hgignore have to be
        called exactly .hgignore? I'm just wondering at this point; I
        haven't decided whether I think it should be required or not.<br>
      </p>
    </blockquote>
    Nope, it can be called whatever you want.<br>
    <blockquote
cite="mid:CAESOdVDf2pwXBvWBaNc5xmrDtFFCuMSZeKhAyXuS2196ombV1g@mail.gmail.com"
      type="cite">
      <p dir="ltr">
      </p>
      <br>
      <div class="gmail_quote">On Fri, May 15, 2015, 03:23 Martin
        Geisler <<a moz-do-not-send="true"
          href="mailto:martin@geisler.net">martin@geisler.net</a>>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">Durham Goode
          <<a moz-do-not-send="true" href="mailto:durham@fb.com"
            target="_blank">durham@fb.com</a>> writes:<br>
          <br>
          > At the moment we only support globs in sub-ignore files.
          regexs will<br>
          > cause an exception. This is because we can't reliabily
          modify a regex<br>
          > to have a prefix (ex: adding a prefix to '^foo|^bar'
          would require<br>
          > parsing the regex).<br>
          <br>
          That is surprising from a high-level since regular languages
          are closed<br>
          under concatenation.<br>
          <br>
          However, I see what you're saying: blindly adding a prefix to
          a regex<br>
          doesn't do what you expect. I didn't look at the mechanics of
          the code,<br>
          but if you could strip off the path elements as you descend
          down the<br>
          directory tree, you should get the right behavior.<br>
          <br>
          So if we have<br>
          <br>
            root/sub-dir/foo/<br>
                         bar/<br>
                         .hgignore <- '^foo|^bar'<br>
                         baz.txt<br>
                 .hgignore <- '#include sub-dir/.hgignore'<br>
          <br>
          then don't match<br>
          <br>
            sub-dir/foo/<br>
            sub-dir/bar/<br>
          <br>
          against<br>
          <br>
            sub-dir/(^foo|^bar)<br>
          <br>
          Instead match<br>
          <br>
            foo/<br>
            bar/<br>
          <br>
          against<br>
          <br>
            ^foo|^bar<br>
          <br>
          to conclude the directories should be ignored.<br>
          <br>
          Maybe that's not what you want if you intend to make one big
          regular<br>
          expression upfront and run all paths through that.<br>
          <br>
          --<br>
          Martin Geisler<br>
          <br>
          <a moz-do-not-send="true"
href="https://urldefense.proofpoint.com/v1/url?u=http://google.com/%2BMartinGeisler&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=pHOG6Hz51SkYmYr%2FxoTFzw%3D%3D%0A&m=OSwxzUTuacvvTTlpHg4tkWDQsomewE5wIJjBQqpEva0%3D%0A&s=0ac94e73b8a813d7fb289cad58251579cae1285ec40b11360fb9c4500c352fa7"
            target="_blank">http://google.com/+MartinGeisler</a><br>
          _______________________________________________<br>
          Mercurial-devel mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:Mercurial-devel@selenic.com" target="_blank">Mercurial-devel@selenic.com</a><br>
          <a moz-do-not-send="true"
            href="http://selenic.com/mailman/listinfo/mercurial-devel"
            target="_blank">http://selenic.com/mailman/listinfo/mercurial-devel</a><br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>