RFC: Extended repository status

Greg Ward greg-hg at gerg.ca
Thu Feb 25 21:31:49 CST 2010


On Thu, Feb 25, 2010 at 4:45 PM, Anton Markov <anton.markov at gmail.com> wrote:
> I propose the following system:
>
> localrepo.basicstatus(self, match, show_ignored, show_clean, show_unknown):
>    - returns the basic status of the working copy against its first parent
>    - works almost exactly like
>      localrepo.status(self, '.', None, match, show_ignored,
>                       show_clean, show_unknown)
>    - uses pluggable 'ignore' functions (see below)

Hey, this also has the benefit of separating out "status of old
revisions" from "status of working dir".  That should make things
easier to follow.

Question: can/should basicstatus() be private?  I.e. should it be
_basicstatus()?  In other words, would it only be used from
localrepo.py, or would it be called from other modules?

> localrepo.status(self, node1, node2, match, show_ignored, show_clean,
>                 show_unknown):
>    - proceeds like the current localrepo.status to compare node1 and node2,
>      using basicstatus as a subroutine
>    - uses pluggable extension functions which are applied to the results of
>      basicstatus
>    - the extension functions would identify themselves in the return value
>      through the use of a flag.
>
> Pluggable "ignore" functions:
>    - Currently dirstate.status takes a 'subrepos' parameter. This is simply
>      an list of subdirectories which are ignored.
>    - Bfiles needs to ignore big files in a similar manner
>    - The generalization is an arbitrary filter that causes some files to be
>      permanently ignored and excluded from both the basic and logical
>      status.
>      Note: The files don't go into "ignored". They are totally excluded.
>    - They are stored in a field of the localrepo object.

Ahh, yeah, that's another nice generalization.  But this should not be
called "ignore", because you can see ignored files with "hg status
-i".  (With current bfiles, "hg status" never ever shows big files;
they are completely invisible.)  How about "disregard"?  Or maybe
"invisible"?  (I like "invisible"... I can ignore something that is
visible, but if it's invisible, I can't even ignore it!)

> Pluggable extension functions:
>    - These functions convert basic status into logical status as necessary.
>    - For example, the bfiles extension would add a new filter function
>      Which would convert the standin files into their big file equivalents
>      and further check their state against the content of the big files.
>    - Extension functions are stored in a field of the localrepo object.

That's not really the Mercurial way.  The tao of hg would have bfiles
instead wrap localrepository.status() to do what it needs.  (Not sure
what subrepos would do, since they are a core feature after all.)

Greg


More information about the Mercurial-devel mailing list