[PATCH 2 of 5] context: make unknown/ignored/clean of cached status empty for equivalence

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Tue Dec 30 23:27:47 CST 2014


At Wed, 31 Dec 2014 01:08:17 +0000,
Martin von Zweigbergk wrote:
> 
> On Tue Dec 30 2014 at 4:19:23 PM FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> wrote:
> 
> > # HG changeset patch
> > # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> > # Date 1419984806 -32400
> > #      Wed Dec 31 09:13:26 2014 +0900
> > # Node ID 6535600e847a3acfe6bb7aa7775d1d15cceab1af
> > # Parent  2e71da5fccb1612f96c8a814bd9641d419f72489
> > context: make unknown/ignored/clean of cached status empty for equivalence
> >
> > Before this patch, "workingctx.status" caches the result of
> > "dirstate.status" directly into "self._status".
> >
> > But "dirstate.status" is invoked with False "list*" arguments in
> > normal "self._status" accessing route, and this makes
> > "unknown"/"ignored"/"clean" of status empty.
> >
> 
> If they're usually empty (and after this patch, always empty), callers can
> not trust the values from unknown(), ignored() and clean(). It seems like
> we should remove the methods in that case. This patch still makes sense,
> but would it be even easier to explain/understand if it came after a patch
> that removed the accessor methods?

You're right.

I only thought about equivalence between routes below:

  - accessing "workingctx._status" at first
    => "dirstate.status(ignored=False, clean=False, unknown=False)" is cached
    => no ignored/clean/unknown files are listed up

  - accesing "workingctx.status()" with list*=True at first
    => "dirstate.status(*=True)" is cached
    => all (or some of) ignored/clean/unknown files are listed up

But, as you said, this patch will make ignored()/unknown()/clean()
completely useless.

In fact, as far as I confirmed, there is no code path using them (by
"string match base checking"), and removing them doesn't cause any
test failure. All existing code paths use "ignored" or so of
"scmutil.status" returned by "status()" on repo or ctx.

I'll resend revised series, soon.

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list