开发者

Howto mirror a mercurial repository

开发者 https://www.devze.com 2023-04-11 04:23 出处:网络
in order to bypass the JIRA-mercurial plugin, I need to replicate my (private) mercurial repository in a private mercurial repository in bitbucket. I and the other users will continue to \"push\" our

in order to bypass the JIRA-mercurial plugin, I need to replicate my (private) mercurial repository in a private mercurial repository in bitbucket. I and the other users will continue to "push" our commits to our ow开发者_如何学Cn private repository, but I want pushed commits to be "forwarded" to a certain bitbucket repository. This way, I can use the JIRA's bitbucket plugin and see the changes related to my bugs.

In other words, I want that, after each push in my private mercurial repository, the commits are forwarded to my repository hosted by bitbucket. I think I should create a push hook, but I never used them before...


I think that the following hook (installed on my server) solves my problem...

[hooks]
changegroup = hg push ssh://hg@bitbucket.org/path/to/my/repository


(Pls, move it into comment of Matteo answer)

changegroup isn't correct type of hook for this task, because

The changegroup hook is activated once for each push/pull/unbundle, unlike the commit hook, which is run once for each changeset

according to docs, and I suppose, more right way is

[hooks]
commit =


Depending on what mercurial client you are using, there are a number of different ways to have your local repository "push after commit".

The TortoiseHg windows client allows you to configure this per-repository for all commits (under the "settings->commit" dialog), as well as for individual commits under the "options" menu when committing.

There are also hook scripts that you can use. A quick google search finds many different options.

0

精彩评论

暂无评论...
验证码 换一张
取 消