Mercurial Mercurial - - PowerPoint PPT Presentation

mercurial mercurial
SMART_READER_LITE
LIVE PREVIEW

Mercurial Mercurial - - PowerPoint PPT Presentation

Mercurial Mercurial


slide-1
SLIDE 1

1

กก กก Mercurial Mercurial

กกกก กกกก (01204223) (01204223)

.. !"#ก$ %ก &'ก( )*+ก,(

slide-2
SLIDE 2

2

Development Timeline

Development Timeline

revision 3: &'()*+ A revision 0: .ก/0 revision 1: .ก23ก X revision 2: .ก23ก Y revision 4: &'()*+ B revision 5: .ก23ก Z : (ก revision)

slide-3
SLIDE 3

3

;*.ก

#-. ( repo* ก+4*)

CVS 8 Concurrent Versions System SVN 8 Apache Subversion

#ก'" (repo -Gก-$H.)

Git Mercurial

Repo

*Repo = Repository " #$ก%&'()

  • $H.
  • $H.
  • $H.

Repo

  • $H.

Repo

  • $H.

Repo

  • $H.

Repo

  • $H.
slide-4
SLIDE 4

4

Workflow

'"ก.#-.

(centralized version control system)

'"ก.#ก'"

(distributed version control system)

Repo

  • $H.

src code

  • $H.

src code

c

  • m

m i t update c

  • m

m i t update

  • $H.

src code Repo

  • $H.

src code Repo

commit/update commit/update push / pull / clone

slide-5
SLIDE 5

5

Mercurial

NO#"ก.#ก'" (44.$ CommandPLine GUI frontend ก

TortoiseHg (Windows/Linux/Mac OS) MacHg (Mac OS X 10.6+)

  • *

http://mercurial.selenic.com/wiki/OtherTools

slide-6
SLIDE 6

6

/@Aก2BCกDกก

ก. CAEE' revision = changeset F*CGE()Eก@CE(.@C DH)/0@ก.กFD (commit message) CGE(.ก b-$*#ก$cd

slide-7
SLIDE 7

7

E)L Mercurial

($4cO+ .hgrc !.efcd4.b'g

b#+'+

กกd$-+Gc.h+4!.cO+ e!(Gb#+'+

i."4

b.h"'j-ก.*kกi.-$"กl.

[ui] username = Firstname Lastname <email@some.where>

slide-8
SLIDE 8

8

กLB myweb

($4 mercurial repository !.c myweb ก mercurial !)$cG$4(.!"cO+ *.pyc

($4cO+ .hgignore c$!. myweb ed$

$ cd myweb $ hg init syntax: glob *.pyc

slide-9
SLIDE 9

9

/2/OAกก

!$m(4 hg status b-(j.'ก"ก.d4

cO+!.e"l

$ 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-ก"ก.

slide-10
SLIDE 10

10

A20F*CGE(กก

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'

slide-11
SLIDE 11

11

Commit Q 2GRกE'

.*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'

slide-12
SLIDE 12

12

Commit .22CSกF*C

cG"mi.$4 commit *gกcO+*ก+.#+4+4!.

.

p.* #G+'.d4NO#

*m4.c$(-&!.4

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..

slide-13
SLIDE 13

13

]กE'

!$m(4 log !$*4+bก Pv b#(4cO+*#ก$cd#+'j-ก.*kก+4

!.#G+'.

$ 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

slide-14
SLIDE 14

14

TortoiseHg

!)$-$!$(44. Mercurial G. GUI !$m(4 hgtk #*.* hg c$กm(4(G.!)tG

$ hgtk add $ hgtk status $ hgtk commit $ hgtk log

slide-15
SLIDE 15

15

E) repository 2;'*

!$ ssh d$c4b4 cloud28 b($4 hg repository c$

กle"ld4.

!$m(4 push *b4.4b(G4d$-+.*h4)cc$

.b4 cloud28

$ 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

slide-16
SLIDE 16

16

กbHC.CAR repository

!$m(4 clone bk4 repository *h4ก$.H.G

.b4*cGe"l-GกG.

!$m(4 pull b!)$ repository !.b4d$-+.

+G(g*-G.NO

$ hg clone ssh://username@cloud28.cpe.ku.ac.th/hg/myweb $ hg pull ssh://username@cloud28.cpe.ku.ac.th/hg/myweb

slide-17
SLIDE 17

17

ก/C2E'

!$m(4 update b+.e$o""g.ci.e$ &

+*.j-ก($4dkh.

e$ci.e$d4.* 3 e$ci.e$d4.+G(g

$ hg update 3 $ hg update

slide-18
SLIDE 18

18

;*.GE(&cBCH

(4 merge b'.G4ก.d$$ก.

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

slide-19
SLIDE 19

19

H_/( merge

$ 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 #$ก%&'()ก$*

slide-20
SLIDE 20

20

กA2ก merge

Repository (4#)G4 (r1 #+' r2) e+."ก*

ก.#G'.G4ก.

slide-21
SLIDE 21

21

กA2ก merge

r2 (4 pull "ก r1 r2 (4 merge #+' commit