how to push to two repositories automatically

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

how to push to two repositories automatically

Uwe Brauer

Hi

I have the following setting in my local hgrc file

[paths]
default = https://kalthad@.../kalthad/chemistry-exercises-problems
sourcehut = ssh://[hidden email]/~oub/chemistry-exercises-problems

[hooks]
incoming.notify = python:hgext.notify.hook
outgoing.notify = python:hgext.notify.hook


changegroup.default = hg push default
changegroup.sourcehut = hg push sourcehut



But hg push only pushes to default not to sourcehut.

What do I miss?

Regards

Uwe Brauer

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: how to push to two repositories automatically

Marcin Kasperski-2
> [paths]
> default = https://kalthad@.../kalthad/chemistry-exercises-problems
> sourcehut = ssh://[hidden email]/~oub/chemistry-exercises-problems
>
> …
> But hg push only pushes to default not to sourcehut.
>
> What do I miss?

https://pypi.org/project/mercurial_all_paths/
;-)

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: how to push to two repositories automatically

David Demelier-2
In reply to this post by Uwe Brauer
Le 12/09/2019 à 21:21, Uwe Brauer a écrit :

> I have the following setting in my local hgrc file
>
> [paths]
> default = https://kalthad@.../kalthad/chemistry-exercises-problems
> sourcehut = ssh://[hidden email]/~oub/chemistry-exercises-problems
>
> [hooks]
> incoming.notify = python:hgext.notify.hook
> outgoing.notify = python:hgext.notify.hook
>
>
> changegroup.default = hg push default
> changegroup.sourcehut = hg push sourcehut
>
>
>
> But hg push only pushes to default not to sourcehut.

Because that's why it's named default :-)

I create alias to push to several repository at once, otherwise a simple
oneliner could do the trick:

     for p in $(hg config paths | cut -d'=' -f2); do hg push $p; done

Also, to my understanding you are trying to create a hook that
automatically sync two repositories. In my opinion it's not the
responsability of a hook especially since sometimes you'll have to
specify bookmarks, --close-branch or --new-branch.

HTH.

--
David

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: how to push to two repositories automatically

Uwe Brauer
In reply to this post by Marcin Kasperski-2
>>> "MK" == Marcin Kasperski <[hidden email]> writes:

>> [paths]
>> default = https://kalthad@.../kalthad/chemistry-exercises-problems
>> sourcehut = ssh://[hidden email]/~oub/chemistry-exercises-problems
>>
>> …
>> But hg push only pushes to default not to sourcehut.
>>
>> What do I miss?

> https://pypi.org/project/mercurial_all_paths/
> ;-)


Great! Works like charm! Precisely what I was looking for.

Thank you very much! Installation and configuration are very clearly
explained!

Uwe

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: how to push to two repositories automatically

Uwe Brauer
In reply to this post by David Demelier-2
>>> "DD" == David Demelier <[hidden email]> writes:

> Le 12/09/2019 à 21:21, Uwe Brauer a écrit :
>> I have the following setting in my local hgrc file
>> [paths]
>> default = https://kalthad@.../kalthad/chemistry-exercises-problems
>> sourcehut = ssh://[hidden email]/~oub/chemistry-exercises-problems
>> [hooks]
>> incoming.notify = python:hgext.notify.hook
>> outgoing.notify = python:hgext.notify.hook
>>
>> changegroup.default = hg push default
>> changegroup.sourcehut = hg push sourcehut
>>
>> But hg push only pushes to default not to sourcehut.

> Because that's why it's named default :-)

> I create alias to push to several repository at once, otherwise a
> simple oneliner could do the trick:

>     for p in $(hg config paths | cut -d'=' -f2); do hg push $p; done

> Also, to my understanding you are trying to create a hook that
> automatically sync two repositories. In my opinion it's not the
> responsability of a hook especially since sometimes you'll have to
> specify bookmarks, --close-branch or --new-branch.

Thanks, but Marcin's package mercurial all_paths

Does precisely what I was looking for (haven't tested it with
--new-branches though).

Uwe

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[notify] (was: how to push to two repositories automatically)

Uwe Brauer
In reply to this post by Marcin Kasperski-2
>>> "MK" == Marcin Kasperski <[hidden email]> writes:

   >> [paths]
   >> default = https://kalthad@.../kalthad/chemistry-exercises-problems
   >> sourcehut = ssh://[hidden email]/~oub/chemistry-exercises-problems
   >>
   >> …
   >> But hg push only pushes to default not to sourcehut.
   >>
   >> What do I miss?

   > https://pypi.org/project/mercurial_all_paths/
   > ;-)

I just realized, that I use notify very often, now my template is this:

template = Subject: [Bitbucket] {webroot|strip}\n
  branches:  {branches}
  changeset: {rev}:{node|short}
  user:      {author}
  date:      {date|date}
  description:
  {desc}\n

Any change to have repository dependent templates?

Regards

Uwe

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[the [auth] problem] (was: how to push to two repositories automatically)

Uwe Brauer
In reply to this post by Marcin Kasperski-2
>>> "MK" == Marcin Kasperski <[hidden email]> writes:

   >> [paths]
   >> default = https://kalthad@.../kalthad/chemistry-exercises-problems
   >> sourcehut = ssh://[hidden email]/~oub/chemistry-exercises-problems
   >>
   >> …
   >> But hg push only pushes to default not to sourcehut.
   >>
   >> What do I miss?

   > https://pypi.org/project/mercurial_all_paths/
   > ;-)

Now I want to push to bitbucket and to helix at the same time, both with
the https protocol

Separately I have

[paths]
default = https://kalthad@.../kalthad/euler-nordstroem


[auth]
repo.prefix = https://bitbucket.org/kalthad/euler-nordstroem
repo.username = kalthad
repo.password = super-secret


[paths]
default = https://helixteamhub.cloud/broad-rain-1388/projects/euler-nordstrom/repositories/mercurial/Euler-Nordstrom

[auth]
repo.prefix = https://helixteamhub.cloud/broad-rain-1388/projects/euler-nordstrom/repositories/mercurial/Euler-Nordstrom
repo.username = oubmatucmes
repo.password = super-secret


How can I achieve this?

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial

smime.p7s (6K) Download Attachment