开发者

Mercurial: Two Windows developers, central repository on my PC. Should I work in the central repository or clone from it?

Is it okay to work in the central repository itself, or is that a "no-no?" Let's say on my PC I have the c开发者_如何学Goentral repository called C:\Src. Is it okay for me to develop right in that repository itself or is that bad form?

Would it be better to clone a new directory called C:\MySrc?

C:\Src is shared on the network and the other developer of course cloned from that.


I would work on a clone of the repository, especially if you are working with multiple developers. In my typical workflow I will make frequent check-ins when I reach a certain point and want to pull down new changes from other developers then once I get to a good state for sharing I push to the central repository.

You may want to also check out using hg serve for sharing instead of using a fileshare as it may work more reliably for you.


Using a local clone enables you to use commands such as hg incomming to see what changes your colleague has pushed. I also recommend using clones as this will result in both of you using the same workflow to apply/retreive changes.


When first working with repositories, you want to focus on the concepts of version control and not get overwhelmed with the "where's my code" anxiety that comes from having more locations than necessary. For this reason, with two developers just getting started I would recommend you each have a single repo which you sync only via pulls from each other. You both need to either unc share or web serve your repos to do that.

I say to only use pulls so that you are always in control of which code has been brought into your repo. This also makes sure that the extension I recommend next is always invoked.

I would also recommend using TortoiseHg, since you are on Windows, as well as the fetch extension (which you can configure to be used automatically during pulls in the Repository Explorer). This will greatly reduce the number of manual steps to keep you in sync when pulling. I do not recommend the rebase extension as I've lost valuable work when using it.

Mozilla's Mercurial guidelines are a good place to start with mercurial.ini as well.


In mercurial there is no central repository. So you can use the repository in your pc directly, there is no need to clone.


Another method for working in the central repo but retaining some control is to allow users to create named branches for their work in the central repo. For example, I may create named branches named "dls_case1", "dls_case2", etc... Then, I am free to push to these named branches without exposing my changes to the wider group. A project lead, or whoever really, can them merge these branches in when appropriate.

Of course, unless you have a good reason I would side with Aaron Weiker and just make developer clones. I just wanted to point out another valid method.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜