Hg workflow for new (SCM) users?

Arne Babenhauserheide arne_bab at web.de
Tue Feb 3 18:41:54 CST 2009

Hi Bernard, 

Am Dienstag 03 Februar 2009 20:19:14 schrieb Bernard Rankin:
> Most of the docs I can find seem to assume the reader is familiar with
> existing software developemnt tools and methodologies.
> This is not the case for me.

It wasn't for me either, and I can assure you that using Mercurial becomes 
natural quite quickly. 

> Now, I need to coordinate with a second (also SCM clueless) programmer.
> I envision us both working the main trunk for many small day-to-day
> changes, and our own isolated repo for larger additions that we will each
> be working on.

I don't know about a HOWTO, but I can give you a short description about basic 
usage and the workflow I'd use: 

## Basic usage: 

* Just commit as you'd have done in SVN via "hg commit". 

* To get changed from others, do "hg pull -u". 
The "-u" says 'update my files'. 

* If you already committed and then pull changes from someone else, you merge 
the changes with yours via "hg merge". Merging is quite painless in Mercurial, 
so you can easily do it often. 

* Once you want to share your changes, do "hg push". 
Should that complain about "adding heads", pull and merge, then do the push 
again. If you really want to create new remote heads, you can use 
"hg push -f". 

## Workflow: 

Firstoff: Create a main repository you both can push changes to. If you have 
ssh access to a shared machine, that's as simple as creating a repository on 
that machine via "hg init project". 

Now both of you clone from that repository via
hg clone ssh://USER@ADDRESS:path/to/project project

(ADDRESS can be either a host or an IP). 

That's your repository for the small day to day changes. 

If you want to do bigger changes, you create a feature clone via
hg clone project feature1

In that clone you simply work, pull and commit as usual, but you only push 
after you finished the feature. Once you finished the feature, you push the 
changes from the feature clone via "hg push" in feature1 (which gets them into 
your main working clone) and then push then onward into the shared repository. 

That's it - or rather that's what I'd do. It might be right for you, too, and 
if it isn't, don't be shy of experimenting. As long as you have a backup clone 
lying around (for example cloned to a USB stick via "hg clone project 
path/to/stick/project"), you can't do too much damage :) 

I hope I could provide a bit of help :)

Best wishes, 
-- Ein Würfel System: http://1w6.org - einfach saubere (Rollenspiel-) Regeln.
-- Infinite Hands: http://infinite-hands.draketo.de - singing a part of the 
history of free software.
-- My stuff: http://draketo.de - stories, songs, poems, programs and stuff :)

-- PGP/GnuPG: http://draketo.de/inhalt/ich/pubkey.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://selenic.com/pipermail/mercurial/attachments/20090204/b9ab8bc3/attachment.pgp 

More information about the Mercurial mailing list