Is it possible to synchronize local/remote repositories without any interaction (i.e. by script)?
Chris Green
cl at isbd.net
Mon Aug 13 20:06:59 UTC 2018
On Mon, Aug 13, 2018 at 05:26:41PM +0000, Becker, Mischa J wrote:
> > -----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.
>
OK, thanks all, I guess I'll just have to try it and see how things go.
--
Chris Green
More information about the Mercurial
mailing list