2011-08-26 56 views
1

我有一个帐户在bitbucket,这是我想实现的。mercurial hg POST到远程服务器与PHP

ME --push--> bitbucket <--post--> server 

服务器到bitbucket很好。

我尝试设置了POST URL这样

<?php `hg pull -u`; 
在我的服务器

。这是正确的方法吗?我尝试应用back tick来执行命令。

+0

我有点不确定你想要做什么。您是否正在使用'hg pull -u'命令*主持* Mercurial?这样它会接受传入的请求并拉(当客户端推送时)? –

+0

im试图做到这一点,除了我使用bitbucket和hg http://net.tutsplus.com/tutorials/other/the-perfect-workflow-with-git-github-and-ssh/ – neotorama

回答

0

我会建议用system()exec()这样做,只是因为这是标准的操作过程。

+0

'<?php system( “hg pull -u”); “是这样的吗? – neotorama

+0

是的,请参阅http://www.php.net/manual/en/function.system.php请注意,php可以从php脚本所在的目录中运行 - 如果您想在其他地方签出资源库,您将必须通过参数来做到这一点。另外请确保您拥有网络服务器用户的所有访问权限。 – ty812