1
กก กก Mercurial Mercurial
กกกก กกกก (01204223) (01204223)
.. !"#ก$ %ก &'ก( )*+ก,(
Mercurial Mercurial - - PowerPoint PPT Presentation
Mercurial Mercurial
1
.. !"#ก$ %ก &'ก( )*+ก,(
2
Development Timeline
revision 3: &'()*+ A revision 0: .ก/0 revision 1: .ก23ก X revision 2: .ก23ก Y revision 4: &'()*+ B revision 5: .ก23ก Z : (ก revision)
3
CVS 8 Concurrent Versions System SVN 8 Apache Subversion
Git Mercurial
Repo
Repo
Repo
Repo
Repo
4
'"ก.#-.
'"ก.#ก'"
Repo
src code
src code
c
m i t update c
m i t update
src code Repo
src code Repo
commit/update commit/update push / pull / clone
5
TortoiseHg (Windows/Linux/Mac OS) MacHg (Mac OS X 10.6+)
6
ก. CAEE' revision = changeset F*CGE()Eก@CE(.@C DH)/0@ก.กFD (commit message) CGE(.ก b-$*#ก$cd
7
กกd$-+Gc.h+4!.cO+ e!(Gb#+'+
b.h"'j-ก.*kกi.-$"กl.
[ui] username = Firstname Lastname <email@some.where>
8
($4cO+ .hgignore c$!. myweb ed$
$ cd myweb $ hg init syntax: glob *.pyc
9
$ hg status ? .hgignore ? __init__.py ? manage.py ? settings.py ? shape/__init__.py ? shape/models.py ? shape/tests.py ? shape/views.py ? templates/index.html ? templates/rectangle.html ? templates/result.html ? urls.py
b4) ? #(4jk4ก*cO+ .h.4cGj-ก"ก.
10
m(4 hg add !$ก!)$ mercurial "ก.!)$cO+
cO+*h4)*4cGj-ก"ก. e'gbcO+ cO+ *.py *gกcO+!.co""g. cO+ *.py *gกcO+!.co""g.#+'Nc*h4) cO+*gกcO+*4cGj-ก"ก ก$.cO+*+4*$$ .html
$ hg add manage.py settings.py $ hg add $ hg add -I '**.py' $ hg add -I '*.py' $ hg add -X '**.html'
11
.*kกe$o""g.i..!)Ge!$m(4 commit
"((j.'cO+กG.e!$m(4 status
$ hg status A .hgignore A __init__.py A manage.py A settings.py A shape/__init__.py A shape/models.py A shape/tests.py A shape/views.py A templates/index.html A templates/rectangle.html A templates/result.html A urls.py $ hg commit –m "First revision" $ hg status $
Commit Message BSDH)./ก.กFD HLBกA2.CAFLH) "Fix bug W" "Add feature W" YCC&Zก hg status ./LBB\F)BCS F*CGE(O]ก.กFD.F)Fก\2C@^E'
12
cG"mi.$4 commit *gกcO+*ก+.#+4+4!.
p.* #G+'.d4NO#
G.#ก$qก(l" 1 #)G4)bOr" 1 G4 cG!$i.*กlcO+*NOk4 s ก+4 s
$ hg status M shape/views.py M templates/rectangle.html A templates/triangle.html M urls.py $ hg commit –m "Fix incorrect URL" shape/views.py urls.py $ hg status M templatesrectanglehtml A templatestriangle.html $
+.#+4 4 cO+ (#ก$ 3 1) CSก commit &E/F*C )+b 2 ก#ก$cd *4cGj-ก.*kก i..
13
$ hg log changeset: 0:87ad7f0fe866 tag: tip user: Chaiporn Jaikaeo <chaiporn.j@ku.ac.th> date: Wed Jul 06 22:07:35 2011 +0700 summary: First revision
Commit message S(Y]2GRกE' C_2/B)CDE' CGE(2GRก
$ hg -v log
14
$ hgtk add $ hgtk status $ hgtk commit $ hgtk log
15
!$ ssh d$c4b4 cloud28 b($4 hg repository c$
!$m(4 push *b4.4b(G4d$-+.*h4)cc$
$ hg push ssh://username@cloud28.cpe.ku.ac.th/hg/myweb
$ ssh username@cloud28.cpe.ku.ac.th Password: : (..h-G*b4 cloud28) $ mkdir hg $ cd hg $ hg init myweb $ logout
16
$ hg clone ssh://username@cloud28.cpe.ku.ac.th/hg/myweb $ hg pull ssh://username@cloud28.cpe.ku.ac.th/hg/myweb
17
e$ci.e$d4.* 3 e$ci.e$d4.+G(g
$ hg update 3 $ hg update
18
Timeline
Repo
;'*กC
Repo
HS(D Chaiporn
Repo
HS(D Jittat
commit push clone clone commit commit pull push push pull merge commit push pull
19
$ hg push #$ก%&'()ก$* pushing to ... searching for changes abort: push creates new remote heads on branch 'default'! (you should pull and merge or use push -f to force) $ hg pull #$ก%&'()ก$* : $ hg merge $ hg commit -m commit message $ hg push #$ก%&'()ก$*
20
21
r2 (4 pull "ก r1 r2 (4 merge #+' commit