Mercurial Intro

10
Mercurial cocoaheads.be

description

Short introduction of Mercurial versioning system made at Cocoaheads Belgium, August 2010

Transcript of Mercurial Intro

Page 1: Mercurial Intro

Mercurial

cocoaheads.be

Page 2: Mercurial Intro

Starting points• Distributed Version Control System

1 2

3

4

Work Area

Commit Update

1 2

3

4

Local Repository Remote Repository

Push

Pull

hg inithg commit -m “fixed that bug”hg updatehg add file1.h file2.m ... hg remove file3.hhg addremove

hg clone [server]hg push [server]hg pull [server]hg fetch [server]

hg summaryhg statushg blame -lun file.m

Page 3: Mercurial Intro

Specificities• Written in Python• Cross Platform (Windows, etc.)

• Extensions

• Easy commands, clean and specific

• Local changeset numbering

• Fast and efficient

• hg serve

• subrepo

• Bitbucket • One free private repository

• Murky.app (GUI)

Page 4: Mercurial Intro
Page 5: Mercurial Intro
Page 6: Mercurial Intro

Subrepo

• Version controlled dependencies• An app that depends on external libs

• Those libs are version controlled

• Keep dependency revision when committing

App A/.hgSources/

file1.cDeps/

Lib B/.git

Lib C/.svn

Page 7: Mercurial Intro

Compared to git• Very similar, yet conceptual differences• Mercurial• Immutability of history

• Consistent & focused interface, extensible

• Anonymous branches

• git

• Content tracking

• Powerful interface, more complexity

• Named branches (namespace, light-weight...)

• Which one should I use?• Xcode4 / cross platform / open source /

dependencies / users skills

• Try both!

• Arrived at about the same time

• As replacements to BitKeeper

• Mercurial projects• Mozilla, OpenOffice, NetBeans, Octave...

Page 8: Mercurial Intro

Use Cases• Creaceed• Source & data repositories• Warning: data repositories can quickly become huge...

• Use something else for data

• Multi-people (2-3) configuration• Specific rights to access certain repositories

• Single ssh account on server, different access rights (per repo)

• Bitbucket

• Kadroid• Before: SVN

• No network > one becomes the server (hg serve)

• Bitbucket