[PATCH 1 of 3] dirstate: don't check state of subrepo directories
Augie Fackler
durin42 at gmail.com
Thu Dec 31 16:00:53 CST 2009
On Dec 31, 2009, at 4:15 PM, Matt Mackall wrote:
> On Thu, 2009-12-31 at 14:36 -0600, durin42 at gmail.com wrote:
>> # HG changeset patch
>> # User Augie Fackler <durin42 at gmail.com>
>> # Date 1261857501 21600
>> # Node ID 68d80c9814d720f2b7d8b2f39008ae6547a5b128
>> # Parent 513c89a60f203a8387d8dfa6f2dc67b21725790a
>> dirstate: don't check state of subrepo directories
>
>> - def status(self, match, ignored, clean, unknown):
>> + def status(self, match, ignored, clean, unknown, skip=[]):
>
> When do we ever not want to skip subrepos? And why not call this arg
> subrepos so we don't abuse it for something else?
Fair enough.
>> - s = self.dirstate.status(match, listignored,
>> listclean, listunknown)
>> + s = self.dirstate.status(match, listignored,
>> listclean, listunknown,
>> + skip=set(ctx1.substate.keys() +
>> + ctx2.substate.keys()))
>
> Why are we passing both contexts' substate info down?
Because dirstate is kind of hairy, and I probably got confused at some
point.
> The only one that is relevant to status in the working directory is
> the workingctx, yes?
Yes, agreed.
> And I think that's always ctx2:
>
> working = ctx2.rev() is None
er, wha? I'm pretty sure it's ctx1. The logic in here is twisty.
> Backing up a bit, it'd be nice to wire this up when we create the
> dirstate object:
>
> @propertycache
> def dirstate(self):
> return dirstate.dirstate(self.opener, self.ui, self.root,
> skiplist)
>
> Then status/walk callers never have to think/know about subrepos,
> which
> is nice. Maybe there aren't enough callers to matter?
This change actually touches all the callers, I grepped around.
> But this implies reading .hgsub (possibly unnecessarily) at create
> time.
Yeah, localrepo has already parsed .hgsub.
> Which we don't really want to do. Nor do we want dirstate to hold a
> reference to localrepo, so passing in a callback tricky.
>
> Alternately, we could teach dirstate internally about parsing .hgsub
> files similar to how it already knows about .hgignore files.
I suppose that would work, and then it'd turn into the same skip list
as now? And then we'll still disable inotify when it's non-empty until
inotify learns?
If it seems like the cleanest way, I'll look at having dirstate
parse .hgsub directly without a context. That seems like the most
viable alternative (right now) to how it's implemented in this change.
> --
> http://selenic.com : development and support for Mercurial and Linux
>
>
More information about the Mercurial-devel
mailing list