[PATCH 1 of 1] Enable commit to disallow recursive submodule commits

Jason Harris jason.f.harris at gmail.com
Fri Apr 23 13:33:21 CDT 2010


Yes it would be quite nice to have status have some option to be able to report that something is a sub-repo. A couple of times I have had a sub-repo in my repository and it looks like its not there and it has confused me for a bit until I realize that there was already repository meta-data in the folder I copied into my repository.

What are the design issues? Beyond say adding  --include-subrepos to the status command?

This I would have assumed would just recursively give the status of the items in the subrepos.

ie. for example

hg status --include-subrepos --modified --added would give all of the normal statuses in the repository and if there is a subrepo which has a modified or added files it would give those paths as well. There are likely design issues I am not thinking of but as a consumer of this functionality in a GUI this would be nice :)

Cheers & Thanks
  Jas


On Apr 23, 2010, at 7:53 PM, Matt Mackall wrote:

> On Wed, 2010-04-21 at 21:02 -0500, Michael Ekstrand wrote:
>> # HG changeset patch
>> # User Michael Ekstrand <michael at elehack.net>
>> # Date 1271900106 18000
>> # Node ID 64e512e0de2d91c6d7dc1975992ccb4b6f0ec46b
>> # Parent  3213e8947975d7a8b44f6a11d063eb949fcb6bb5
>> Enable commit to disallow recursive submodule commits
>> 
>> This patch adds support to commit for a 'commit.recursive' option, defaulting
>> to true, which controls whether or not commit recursively commits submodules.
> 
> Sorry, I don't like this.
> 
> Recursive commit is just how Mercurial works, with or without subrepos.
> You should be no more suprised when Mercurial commits files in a
> subdirectory than when it commits a subrepo. Commits are by design
> snapshots of an entire project state, and that definitely includes
> subrepo state. Adding a (misnamed) flag to grossly change Mercurial's
> philosophy is not appealing. Also, it'd need to be turned off in plain
> mode for GUI integration, and that'd make it pretty much pointless. Nor
> am I much interested in command line options, etc.
> 
> Now I understand that there is currently no easy way to know when a
> subrepo is dirty, and there's probably no warning in the commit editor
> that you're about to commit subrepos, and so most people are in fact
> surprised. But that's not because of the recursion, it's because we're
> simply not reporting it yet.
> 
> Let's focus on that instead. For starters, we need hg summary to tell us
> about dirty subrepos (easy). And for commit to warn us about subrepos
> it's committing (also easy). Then we need to figure out how to report
> subrepos in status in a way that doesn't confuse all the GUI tools that
> use it. That's a bit harder.
> 
> -- 
> http://selenic.com : development and support for Mercurial and Linux
> 
> 
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list