如何最好地为Mercurial配置一个中央存储库/多个中央存储库? [英] How to best configure a central repository/multiple central repositories for Mercurial?

查看:79
本文介绍了如何最好地为Mercurial配置一个中央存储库/多个中央存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Mercurial的新手,试图弄清楚它是否可以替代SVN.与我一起工作的每个人都使用了SVN,CVS和VSS(颤抖),因此这可能是一个很大的变化.在阅读了它的合并和分支功能之后,我一直很感兴趣,但是有一些保留意见.

I am new to Mercurial and trying to figure out if it could replace SVN. Everyone I work with has used SVN, CVS and VSS (shiver), so this could be quite a large change. I have been very interested after reading about its merge and branch capability, but have a few reservations.

我们当前使用的是SVN,并且有一个中央存储库.根据我的阅读,使用Mercurial时似乎没有一个针对所有项目的中央存储库.注意:我们认为每个项目都是单独的逻辑代码集或Visual Studio解决方案.它可以独立运行.

We are currently on SVN, and have one central repository. From my reading, it seems as though there is no ONE central repository for all projects when using Mercurial. NOTE: We consider each project a separate logical set of code, or a Visual Studio Solution. It runs on its own.

我们的一个中央SVN存储库中有大约60个独立的项目.在阅读了有关Mercurial的内容之后,在我看来,我必须为服务器上的每个这些项目创建60个单独的中央存储库.问题1:我应该为每个项目创建一个存储库吗?

We have around 60 separate projects in our one central SVN repository. After reading about Mercurial it seems to me that I have to create 60 separate central repositories for each one of these projects on the server. QUESTION #1: Should I create a single repository for each project?

如果是,那么我担心配置和托管60个单独的中央Mercurial服务器.我开始考虑可以配置一个文件,但似乎必须使用"C:... \ MyRepository.hg \ hgrc"文件(Windows安装)分别配置每个存储库.好像我必须运行60台服务器(> hg服务),因此我假设使用不同的端口.问题2:如果对问题1的回答是是",则每个项目应该有一个中央存储库,那么人们如何管理多个存储库?

If yes, then I am worried about configuring and hosting 60 separate central Mercurial servers. I started thinking I could configure one file, but it seems as if each repository must be individually configured using the "C:...\MyRepository.hg\hgrc" file (Windows install). It also seems as I have to run 60 servers (>hg serve), I would assume on different ports. QUESTION #2: If the answer to question 1 is yes, there should be a single central repository for each project, then how have people managed many multiple repositories?

最后,我还没有考虑过将所有历史记录和更改从一个SVN存储库移至一堆单独的Mercurial存储库中,但是希望这样做的人(或什至有可能)发表任何意见.

Finally, I haven’t looked into moving all history and changes from one SVN repository to a bunch of separate Mercurial repositories, but would appreciate any comments from someone who has done this (or if it is even possible).

推荐答案

Mercurial很好地支持中央存储库",但是它是按惯例而不是法定的.

Mercurial supports "central repositories" just fine, but it does them by convention rather than fiat.

您只需要运行一台服务器即可运行所有60个存储库,并且不会使用hg serve.相反,您可以从发布选项中选择一种生产质量方法.您可能会根据自己的喜好在Apache,Nginx或IIS之后运行hgwebdir.

You need run only a single server to run all sixty repositories, and you wouldn't use hg serve for it. Instead you pick one of the production-quality methods from among the publishing options. Likely you'll run hgwebdir behind Apache, Nginx, or IIS depending on your preferences.

一旦运行,您就可以在存储库目录中使用hg inithg clone创建新的副本.在以前的雇主中,我们有五种产品,每种产品都有一个中央"存储库,并且针对各种团队和功能,每种都有十到二十个克隆,所有这些都在单个服务器上运行.中央存储库确定什么是官方的",但您会发现临时出现的非官方功能存储库一直在兴起.

Once that's running you can create new repsitories with hg init or hg clone within your repositories directory. At a previous employer we had five products, with a "central" repository for each, and ten to twenty clones of each for various teams and features, all running in a single server. The central repo determines "what's official" but you'll find impromptu repos for unofficial features springing up all the time.

hg serve供两个开发人员匆忙交付一些变更集,但已发布的回购协议需要更多的脚手架.

hg serve is for two devs to hand off some changesets in a hurry, but published repos require a little more scaffolding.

这篇关于如何最好地为Mercurial配置一个中央存储库/多个中央存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆