Using mercurial for configuration files version control

Stefan Rindeskar sterin71 at gmail.com
Thu Nov 25 16:38:53 UTC 2010


On Thu, Nov 25, 2010 at 4:52 PM, Tom Widmer <tom.widmer at googlemail.com> wrote:
> On 25/11/2010 13:54, Vadym Chepkov wrote:
>>
>> First challenge - I am not able to clone remote repository into an
>> existing /etc directory on a second node - there is no such thing as
>> "force", at least I wasn't able to find it. So, instead, I did hg
>> init on the second node and did hg pull ssh://master//etc/ . This
>> concerns me a bit, because the repositories don't have a common
>> "parent", don't know how essential this is.
>
> They do have a common parent - the revision 0 is identical for all repos and
> is acting as the common parent in this case.
>

Or you could just do as Jouni Iraksinen suggested and just _copy_ the
.hg directory into the the /etc directory on the new server.
That way you would have all the history from your original repo in a
new working directory.

Then you create a branch in the local repository on each server named
after the servername where you can commit the local changes.

And then by using the the fetch extension as Tom mentions all local
changes that is part of the local branch should automatically be
merged with the "foreign" default branch that comes from your master.
Since you are only pulling from your master repository you should only
have two branches to merge on each server which makes it easy.

It's just that the branch is named differently on each server (the
reason I had for this was if you want to create some kind of backup
scenario where you actually pull all branches into one repository, and
to avoid too much confusion in case you accidentally managed to push
some changes up to the master).

/Stefan



More information about the Mercurial mailing list