如何在共享中央服务器上轻松发布新的 Mercurial 存储库或子存储库? (推克隆)
Mercurial 丰富的发布选项包括 HgWeb(以前称为 HgWebDir),它几乎可以完美满足我的需求。 HgWeb 1.6 支持多个存储库,包括集合。
因此 hgweb.config 可能包含如下内容:
[collections]
/home/user/collection1 = /home/user/collection1
/home/user/collection2 = /home/user/collection2
因此,上述文件夹(collection1、collection2)可能各自包含大约 10-20 个存储库(作为子文件夹),位于上述位置。
我的问题是,是否有任何 hg 扩展或配置技术可以让我将克隆推送到 hgweb 提供的集合?
我在 Linux 上的常用方法是使用 SSH 远程登录,然后对我的开发人员工作站副本进行 hg 克隆
,我暂时使用“hgserve”提供该副本。我发现我与一些精通 Linux 的开发人员一起工作,他们可以毫无问题地通过 ssh 进入盒子并使用 hg 进行操作。但是 Windows 用户 (a) 不熟悉 ssh,并且 (b) 不了解 Linux 命令行环境,并且想要一种使用 IDE 版本控制插件、GUI 工具或 CGI 页面的方法(由我用 python 编写), 远程拉取克隆,为他们提供了一种有效的方式将其 HG 存储库推送或发布到中央存储库,而无需借助对远程服务器系统的任何 ssh 访问。在奇怪的情况下,集中式 Mercurial 服务器在 Windows 上运行,您甚至可能无法通过 ssh 访问远程服务器。
在我看来,答案是“不,你不能这样做”,除非我为 hgweb 编写自己的扩展,这是我即将要做的。但如果 hg 中有一种方法可以做到这一点,我想知道。
相关问题:
<一个href="https://stackoverflow.com/questions/2748552/how-to-best-configure-a-central-repository-multiple-central-repositories-for-merc">使用 Mercurial 的多个中央存储库
Mercurial's vast publishing options include HgWeb (and formerly HgWebDir), which is almost perfect for my needs. HgWeb 1.6 supports multiple repositories, including collections.
So hgweb.config could contain something like this:
[collections]
/home/user/collection1 = /home/user/collection1
/home/user/collection2 = /home/user/collection2
So, the above folders (collection1, collection2) might each contain about 10-20 repositories, as subfolders, in the above locations.
My question is, is there any hg extension, or configuration technique that will allow me to push a clone up to a collection being served by hgweb?
My usual approach on Linux is to login remotely using SSH and then do an hg clone
of my developer workstation copy, which I momentarily serve up using `hg serve'. I find that I work with some Linux-savvy developers, who have no problem ssh-ing into a box, and doing stuff with hg. But windows users (a) don't grok ssh, and (b) don't know Linux command line environments, and want a way either with their IDE version control plugins, or GUI tools, or with a CGI Page (written by me in python), to remotely pull a clone, giving them effectively a way to push or publish their HG Repository up to a central repository without recourse to any ssh access to the remote server system. In the odd case that a centralized mercurial server was running on Windows, you might not even be ABLE to ssh into the remote server.
It seems to me the answer is "no you can't do this", unless I write my own extension for hgweb, which I am about to do. But if there is a way to do this already in hg, I would like to know it.
Related questions:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Mercurial 的默认 Web 界面不支持远程创建存储库(请参阅 为什么 Mercurial 不支持通过 HTTP 远程创建存储库? )。但是,如果您的开发人员同事原则上被允许使用 SSH 登录 Mercurial 服务器,并且该服务器上有某种可由多个用户访问的共享文件空间,则您可以使用 将本地存储库克隆到服务器SSH 存储库 URL(请参阅此答案)。这对于 Windows 用户来说也应该很容易,因为低级 SSH 的东西是由 Mercurial 完成的。
The default web interface of Mercurial does not support remote creations of repositories (see Why doesn't Mercurial support remote repository creations over HTTP?). However, if your fellow developers principally are allowed to login to the Mercurial server using SSH and if you have some kind of shared filespace on that server which can be accessed by multiple users, you could clone local repos to the server using an SSH repo URL (see this answer). That should be also easy for Windows users too as the lowlevel SSH stuff is done by Mercurial.