Here's a patch that implements and tests Immutable ConfigSets. This seems useful by itself (in the case where you don't want the config to be modified), but could have more uses in the future with config templates and/or a ConfigSet API (that e.g. let you copy / instantiate [copy and unset immutable] ConfigSets).
One part I am unsure about is the best way to mark a ConfigSet as being immutable. The solution I chose was to have a file in the configDir named "configSet.immutable". I chose that for three reasons:
1) It exists outside of the solrconfig / schema, which maps well to what the ConfigSet represents
2) It can be easily skipped as part of an "instantiate" operation as described above (where we copy a ConfigSet but turn off immutable) via a ConfigSet API call
3) It works for both local filesystem and ZK configurations (my original idea was to write some properties in the base directory for ZK data, but that wouldn't work for the local filesystem).
Maybe this would be better:
We have an optional file named "configSet.properties" that lets you specify (json?) properties that apply to the configset. Today, "immutable" would be the only one that has any meaning, but we could extend this in the future for other properties (e.g. you could have authorization information relevant to a ConfigSet API or specifications like "shareable" [can more than one collection use this as a base]?). The properties file also passes the three motivations listed above.