[PATCH RFC] status: show changed subrepos

Angel Ezquerra angel.ezquerra at gmail.com
Wed Apr 3 09:24:41 CDT 2013


On Wed, Apr 3, 2013 at 4:21 PM, FUJIWARA Katsunori
<foozy at lares.dti.ne.jp> wrote:
>
> At Wed, 3 Apr 2013 07:34:34 +0200,
> Angel Ezquerra wrote:
>>
>> On Tue, Apr 2, 2013 at 6:38 PM, FUJIWARA Katsunori
>> <foozy at lares.dti.ne.jp> wrote:
>> >
>> > At Sat, 23 Mar 2013 14:08:52 +0100,
>> > Angel Ezquerra wrote:
>> >>
>> >> # HG changeset patch
>> >> # User Angel Ezquerra <angel.ezquerra at gmail.com>
>> >> # Date 1364044094 -3600
>> >> #      Sat Mar 23 14:08:14 2013 +0100
>> >> # Node ID b157dada53f6a5570fcc166757c13a4362f9f1b5
>> >> # Parent  e2feb2896b75863fdff27292db32dbc56b20a3dd
>> >> status: show changed subrepos
>> >>
>> >> This is a proof of concept of how we could show "changed subrepos" in the
>> >> output of the status command. The idea is to add new "S" status entries, which
>> >> show subrepos that have changed (i.e. that have been added, removed or that are
>> >> dirty because they have been updated to another revision or because they
>> >> contain changed files).
>> >>
>> >> This patch is not complete and is not meant to be included (yet):
>> >>
>> >> - It does not really handle new and deleted subrepos, despite what the docstring
>> >> says.
>> >>
>> >> - I added the code right into commands.status because it was very easy to add
>> >> there, but a proper version of this patch would probably modify
>> >> localrepo.status instead.
>> >>
>> >> Other potential issues and things to discuss:
>> >>
>> >> - I chose --changed-subrepos as the switch longstring to make it clear that it
>> >> is not the same as the existing --subrepos flag.
>> >>
>> >> - I made the short version of the switch be "-s". There is already a -S flag. I
>> >> don't see that as a big problem since there are other cases where this happens
>> >> in mercurial (e.g. update -C vs update -c). Fortunatelly all other similar
>> >> switches (e.g. -m, -a) are also lower case.
>> >
>> > I've also wanted such status showing about subrepos currently managed,
>> > because there is no way to know whether ".hgsub"/".hgsubstate" will be
>> > committed or not before real committing !
>> >
>> >
>> > What about "--substate" to mean checking against ".hgsubstate" file ?
>>
>> Do you mean changing the behavior of the existing --substate flag?
>> Wouldn't that break backward compatibility? That is why I added a new
>> flag. Plus that let us separate the "show which subrepos changed part"
>> from the "show what changed in the subrepos" part.
>>
>> Do you like the way the proposed patch shows the changed subrepos?
>>
>> Cheers,
>>
>> Angel
>
> Sorry, I couldn't find "existing --substate flag" in "commands.py" and
> sources in "hgext" on today's heads revisions: 78d760aa3607 in default
> and 801d3db0473c in stable.
>
> I expect:
>
>   --subrepos => "show what changed in the subrepos"
>   --substate => "show which subrepos changed part"
>
> Perhaps, do you mean "--sub<repos> and --sub<state> are confusing for
> each other" ?
>
> OK, I withdraw my proposal, if so.

Sorry, I was confused. I missred your proposal. When you said
"--substate" I understood "--subrepos". All the while I was writing
"--substate" I was actually thinking "--subrepos".

Now I understand your proposal. I think --substate actually may be a
better option than my suggested --changed-subrepos, so I would not be
against using your suggestion instead. I think people that use
subrepos are likely to understand the difference between "substate"
and "subrepo".

What do other people think?

Angel


More information about the Mercurial-devel mailing list