views:

100

answers:

2

Hi All, Im in the process of trying to get my head round a dvcs such as mercurial. Im getting quite confused with certain points though. Firstly, a bit of context:

At the minute i mostly use subversion, and it works fine for my workflow,

Mostly the repository is for my own use, im the only web developer,and i only ever submit raw code to my manager, he never has to see the repository.

I use the repo to create major versions, and as backup so i can revert to it when something doesnt work out.

The repo also acts a file share, enabling me to work from the same codebase at work and at home.

My main reason for wanting to switch to mercurial, is the offline commits and easier branching / merging.

Firstly can anyone tell me how i would get mercurial to fit this workflow?

How do i go about sharing multiple repositories (i.e. one for each project) between computers?

Any help would be hugely appreciated, Thanks

+4  A: 

http://hginit.com/

There is a fantastic pre-chapter there specifically for SVN users. The rest of the tutorial will get you on your feet fairly quickly.

Matt
+1  A: 

I'll answer just one part of your question, that of how to manage access to your repository from both home and work, because this is one of the situations where distributed version control is really useful.

The answer is that your two repositories are clones of one-another (to be correct, one is the clone of the other). You do some work during the day, check it in, then pull that work to your home repository (or push, but that requires more work). The next morning, you do the same thing in reverse. Mercurial comes with a built-in read-only HTTP server that makes it really easy, provided that you can expose a port.

The end result is that you have two repositories (ie, automatic backup of the entire history). At any given point in time, one is "better" than the other, but since you're the sole committer to both, they won't diverge.

Anon
If your repository is in the same location on both machines then you can clone one to a memory stick and then push/pull from the memory stick very easily. Some short 1 line scripts can help this along if home and work repos aren't in the same place.
Mark Booth