Using mercurial for configuration files version control

Martin Geisler mg at aragost.com
Thu Nov 25 09:21:51 CST 2010


Vadym Chepkov <vchepkov at gmail.com> writes:

> On Nov 25, 2010, at 9:58 AM, Martin Geisler wrote:
>
>> Vadym Chepkov <vchepkov at gmail.com> writes:
>> 
>>> I basically need a tool that can track and apply "patches" for me and
>>> I was hoping mercurial is capable to do this.
>> 
>> The mq extension does exactly that: it maintaines a stack of patches on
>> top of normal Mercurial changesets.
>> 
>>  http://mercurial.selenic.com/wiki/MqExtension
>
> mq is managing local patches, if I am not mistaken, whereas I need to
> apply remote changes, remote deltas.

I proposed to store the local differences in MQ patches and store the
common parts in normal changesets.

> If mercurial doesn't speak "deltas" and only compares the whole file
> every single time and this can't be changed, I guess it's just a wrong
> tool for the tack in hands.

The nicest solution I know of is to put the local customizations for a
file foo into a file called foo.$HOSTNAME and then include foo.$HOSTNAME
into foo. This works great if the file format allows including other
files and if it can work with environment variables.

Failing that, I think a MQ patch would be an okay solution.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/


More information about the Mercurial mailing list