Mercurial

Quick stark

source http://mercurial.selenic.com/

Clone a project and push changes

$ hg clone http://selenic.com/repo/hello
$ cd hello
$ (edit files)
$ hg add (new files)
$ hg commit -m 'My changes'
$ hg push

Create a project and commit

$ hg init (project-directory)
$ cd (project-directory)
$ (add some files)
$ hg add
$ hg commit -m 'Initial commit'

show tags

hg tags

Mercurial sw development

sorce of this guide http://mercurial.selenic.com/wiki/Tutorial

sudo apt-get install mercurial
~/test-mercurial$ mkdir repo
~/test-mercurial$ cd repo/
~/test-mercurial/repo$ ls
~/test-mercurial/repo$ hg init

create e fiel .hgrc and put an username
nano .hgrc
[ui]
username = John Doe <john@example.com>
~/test-mercurial/repo$ ls
~/test-mercurial/repo$ ls -la
total 12
drwxrwxr-x 3 giuseppe giuseppe 4096 Nov  4 16:22 .
drwxrwxr-x 3 giuseppe giuseppe 4096 Nov  4 16:22 ..
drwxrwxr-x 3 giuseppe giuseppe 4096 Nov  4 16:22 .hg

Useful commands

give the last 3 logs of the repository , with info about tags ecc

hg log -l3

give the number of the commit of the repository, with the command upstairs you can understand what there is inside

hg id -n

examples in this repository there is the version GA2.30.16

hg tags | head

tip                              563:27f3f730e29d
GA2.32                           562:417b68549ed0
PRE_RELEASE_2_32                 561:7febd602a810
GA2.31                           559:80da05081963
GA2.30.18                        556:3bebad282822
GA2.30.17                        555:dad36acc6458
GA2.30.16                        553:db00d7e1e20f
GA2.30.15                        548:6c99ab00aed9
GA2.30.14                        546:9145f11f3b0f
GA2.30.13                        545:ff0f379784dc

hg id -n
553

Merge two heads

hg heads
hg up 169
hg merge 171
hg heads
hg status
hg commit
hg commit -m 'merge two heads'
hg push 
hg status
hg heads
Salvo diversa indicazione, il contenuto di questa pagina è sotto licenza Creative Commons Attribution-ShareAlike 3.0 License