[PATCH] localrepo: abort commit if a subrepo is modified and ui.commitsubs=no

Patrick Mézard pmezard at gmail.com
Mon Feb 14 01:55:17 CST 2011


Le 14/02/11 03:09, Mads Kiilerich a écrit :
> Patrick Mezard wrote, On 02/12/2011 06:00 PM:
>> # HG changeset patch # User Patrick Mezard<pmezard at gmail.com> #
>> Date 1297528291 -3600 # Node ID
>> c144bfef2727616001b3c7fa6fd1db8049188497 # Parent
>> d4ab9486e514dd24e21a2ca3b6c439ea13d85cab localrepo: abort commit if
>> a subrepo is modified and ui.commitsubs=no
>> 
>> The default behaviour is to commit subrepositories with uncommitted
>> changes. In my experience this is usually undesirable:
>> 
>> - Changes to dependencies are often debugging leftovers - Real
>> changes should generally be applied on the source project
>> directly, tested then committed. This is not always possible,
>> subversion subrepos may include only a small part of the source
>> project, without the tests.
>> 
>> Setting ui.commitsubs=no will now abort commits containing such
>> modified subrepositories like:
>> 
>> $ hg --config ui.commitsubs=no ci -m msg abort: uncommitted changes
>> in subrepo sub
> 
> +1
> 
> We don't use the abbreviation "subs" in other places, so I think
> "commitsubrepos" would be better even though it is a bit long.

Yes. My only problem with options ending with "subrepo" is I never remember if they are singular or plural :-).
 
> This new setting should perhaps be mentioned in the subrepo help
> topic too.

Sure, I forgot this one.

> But do this setting really belong as a config setting? It is a
> setting that all users of a given subrepo should agree on, so it
> seems like it would be better to store it for example in .hgsub .

I disagree with you here, this looks more like a workflow policy than a technical constraint to be enforced at project level. If a coworker never pushes changes breaking subrepos tests because of recursive commits without using this option, fine.
 
> Actually I like this setting so much that I would like to have it set
> to False by default.

Yes, that was the default in subversion. Not sure how it works since 1.6 which enabled commits from svn:externals.
 
--
Patrick Mézard


More information about the Mercurial-devel mailing list