Version Management

History:

Shared File System

RCS

Single Repository

CVS, Subversion

Multiple Repositories

Mercurial, Git, Bazaar

Actually in use:

Subversion

Legacy projects

GIT

Unix Projects

Mercurial

Java / Python projects DV

Mercurial

Common to all DVCS:

  • Distributed Version System

  • Every client has a full copy of the repository

  • Efficient Micro-Checkins

  • Can push / pull from any other client copy

  • Allow efficient branching

Important commands

hg init

create repository

hg clone

clone existing repository. Automatically makes this the default repository.

hg push

push changes to default remote repository

hg pull

pull changes from default remote repository (warning: does NOT update. Use hg pull -u )

hg commit

Check changes into local repository

hg update

Update files in local repository

hg heads

shows if there are different head revisions

hg merge

merges multiple head revisions

Can be configured in .hg/hgrc

Supports Plugins (here: Windows / Unix LF Conversion, Keyword expansion)

Example 3. Example hgrc
[paths]

[extensions]
hgext.keyword=
hgext.win32text=

[keyword]
**.java =

[encode]
** = cleverencode:

Ignore files can be configured using .hgignore in your root directory.

  • Files will not be added to the repository

  • Will not show up as changed

  • Normally: All generated directories

  • Maven: target directory

Example 4. Example .hgignore
syntax: regexp

target/
^test
^.*patch$

Links: