Is it possible to synchronize local/remote repositories without any interaction (i.e. by script)?

Becker, Mischa J mischa.becker at kroger.com
Mon Aug 13 17:26:41 UTC 2018


> -----Original Message-----
> From: Chris Green
> Sent: Sunday, August 12, 2018 1:56 PM
>
> On Sun, Aug 12, 2018 at 01:46:39PM -0400, Augie Fackler wrote:
>>    On Aug 12, 2018, at 10:00 AM, Chris Green <[1]cl at isbd.net> wrote:
>>>
>>>    These need to be as far as possible silent scripts, as noted
>>>    above I'm happy to have them talk to me if there's a conflict
>>>    of some sort but otherwise I want quietness.  I can probably
>>>    manage to make the ssh access password/key-less but how easy is
>>>    it to automate the mercurial bits?
>>>
>> Should be pretty easy - `hg push && hg pull` is probably all you
>> need, and if either of those exit nonzero you need to do some kind
>> of merge.
>
> So if I make a change on a 'remote' machine and commit it to the local
> repository then all I need do is 'push <central repository>' and the
> change will be there too?  I thought doing that would create a branch
> and that someone/somewhere then had to do a merge on the 'central'
> repository.

Branching only happens when there are two or more commits with the same parent.  Since you are the only one committing to these repositories, as long as all existing commits are in the central repository to be pulled and you remember to update your working directory to tip after pulling them and before you commit any new changes, then you aren't creating anonymous branches.

I found the diagrams at http://hginit.com/02.html helpful when I was first learning.

Mischa

________________________________

This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.


More information about the Mercurial mailing list