[PATCH 1 of 7] match: if the repo root is a root, that is the only root we need

Mads Kiilerich mads at kiilerich.com
Mon Jan 20 19:52:00 CST 2014

On 01/21/2014 12:37 AM, Matt Mackall wrote:
> On Thu, 2014-01-16 at 02:18 +0100, Mads Kiilerich wrote:
>> # HG changeset patch
>> # User Mads Kiilerich <madski at unity3d.com>
>> # Date 1380816081 -7200
>> #      Thu Oct 03 18:01:21 2013 +0200
>> # Node ID 7a74b5ba8e5e663786774fe84ec4ecca0207a9c5
>> # Parent  47d0843647d1e32f6af4482867327cec5db11a1f
>> match: if the repo root is a root, that is the only root we need
>> It will change what ends up in .files() and what is .exact(), in a way that is
>> more correct and efficient than before.
> What was it doing before, how was it incorrect, and what is it doing
> now? You have this info at your fingertips, I have to acquire it by
> expensive, error-prone reverse-engineering of your patch, so please
> include it in the description.

Hmm. Right. I failed in the error-prone reverse-engineering of the code.

I now see that _roots() also returns exact matches and that .exact() 
also returns roots (when .anypats() is true).

.exact() can thus only be used after checking that .matchfn matches and 
that it not just is a root, and .files() can also contain both files and 

I think that the thing that initially led me in the wrong direction was 
that .files() can contain the same root multiple times and thus in some 
cases would walk the same tree multiple times.

I will revisit later.


More information about the Mercurial-devel mailing list