Differences between revisions 1 and 2
Revision 1 as of 2008-01-24 06:37:29
Size: 134
Editor: JungSangil
Comment:
Revision 2 as of 2008-01-24 06:55:04
Size: 6937
Editor: JungSangil
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
머큐리얼 초보자에게 어려울 수 있는 분산형 개발 모델이다. 이 페이지는 기초적인 개념을 설명한다.
한단계씩 따라해 보려면 ["KoreanTutorial"]를 참고하라.

''(Translations:
[:BrazilianPortugueseUnderstandingMercurial:Brazilian Portuguese],
[:ChineseUnderstandingMercurial:Chinese],
[:FrenchUnderstandingMercurial:French],
[:GermanUnderstandingMercurial:German],
[:ItalianUnderstandingMercurial:Italian],
[:JapaneseUnderstandingMercurial:Japanese],
[:KoreanUnderstandingMercurial:Korean],
[:SpanishUnderstandingMercurial:Spanish]
)''


[[TableOfContents]]

== Repository에 있는 것들 ==

머큐리얼의 [:Repository:repositories]에는 store과 함께 [:WorkingDirectory:working directory]가 있다:

{{{#!dot
digraph G {
 compound=true;
 rankdir = LR
 background="#999999";
 subgraph cluster_1 {
  style=filled;
  color="#eeeeee";
  node [shape=box,style=filled,color=lightgray];
  "rev 0" -> "rev 1" -> "rev 2" -> "rev 3";
  label = "store";
 }
 subgraph cluster_0 {
  style=filled;
  color=lightgrey;
  node [style=filled,color=white];
  edge [style=invis];
  "main.c"-> "main.h" -> ".hgignore" -> ".hgtags"
  label="working directory";
 }
 "rev 2" -> ".hgtags" [lhead = cluster_0 constraint=false]
}
}}}

store에는 프로젝트에 대한 '''완전한''' 이력이 남아 있다. 이러한 이력을 중앙 한곳에만 가지고 있는 전통적인 [:SCM:SCMs]과는 달리 모든 working directory는 이력에 대한 복사본을 쌍으로 가지고 있다. 이것은 병행적으로 개발하는 것을 가능케 한다.

working directory는 편집을 위한 준비로 특정 시점에(예를 들어 rev 2) 프로젝트의 파일의 복사본을 포함하고 있다. 왜냐하면 같이 포함되어 있는 [:Tag:tags]와 ignore files는 revision-controlled이기 때문이다.

== 변경사항 Commit 하기 ==

[:Commit:commit]을 할때, working directory의 상태는 새로운 [:Revision:revision]으로 기록 되어진 그것의 [:Parent:부모] 와 관련이 있다.

{{{#!dot
digraph G {
 compound=true;
 rankdir = LR
 background="#999999";
 subgraph cluster_1 {
  style=filled;
  color="#eeeeee";
  node [shape=box,style=filled,color=lightgray];
  "rev 0" -> "rev 1" -> "rev 2" -> "rev 3";
  "rev 2" -> "rev 4";
  label = "store";
 }
 subgraph cluster_0 {
  style=filled;
  color=lightgrey;
  node [style=filled,color=white];
  edge [style=invis];
  "main.c"-> "main.h" -> ".hgignore" -> ".hgtags"
  label="working directory";
 }
 "rev 2" -> ".hgtags" [style = dotted lhead = cluster_0 constraint=false]
 "rev 4" -> ".hgtags" [lhead = cluster_0 constraint=false]
 ".hgtags" -> "rev 4" [color = red label = "commit" ltail = cluster_0 constraint=false]
}
}}}

revision 4는 working directory에 있는 revision이었던 revision 2의 '''branch'''임을 주의하라. 이제 revision 4는 working directory의 '''parent'''이다.

== Revisions, Changesets, Heads, and Tip ==

Mercurial groups related changes to multiple files into single atomic [:ChangeSet:changesets], which are revisions of the whole project.
These each get a sequential [:RevisionNumber:revision number]. Because Mercurial allows distributed parallel development, these revision numbers may disagree between users. So Mercurial also assigns each revision a global [:ChangeSetID:changeset ID]. Changeset IDs are 40-digit hexadecimal numbers, but they can be abbreviated to any unambiguous prefix, like "e38487".

{{{#!dot
digraph {
   rankdir = LR
   node [shape=box]
   "rev 0:838e" -> "rev 1:34ef" -> "rev 2:4563"
   "rev 1:34ef" -> "rev 3:fe56"
   "rev 2:4563" -> "rev 4:ac98"
   "rev 3:fe56" -> "rev 4:ac98"
   "rev 4:ac98" -> "rev 5:0345"
   "rev 4:ac98" -> "rev 6:19e3 (tip)"
   label="example history"
}
}}}

Branches and [:Merge:merges] in the revision history can occur at any point. Each unmerged branch creates a new [:Head:head] of the revision history.
Here, revisions 5 and 6 are heads. Mercurial considers revision 6 to be the [:Tip:tip] of the repository, the head with the highest revision number.

== Cloning, Making Changes, Merging, and Pulling ==

Let's start with a user Alice, who has a store that looks like:

{{{#!dot
digraph {
   label="Alice's Repo"
   rankdir = LR
   node [shape=box]
   a->b->c->d
}
}}}

Bob [:Clone:clones] this repo, and ends up with a complete copy of Alice's store (though his working directory is independent!):

{{{#!dot
digraph {
   label="Bob's Repo"
   rankdir = LR
   node [shape=box]
   a->b->c->d
}
}}}

Bob then [:Commit:commits] a couple changes:

{{{#!dot
digraph {
   label="Bob's Repo"
   rankdir = LR
   node [shape=box]
   a->b->c->d->e->f
   e [color=blue]
   f [color=blue]
}
}}}

Alice then makes her own change in parallel:

{{{#!dot
digraph {
   label="Alice's Repo"
   rankdir = LR
   node [shape=box]
   a->b->c->d->g
   g [color=red]
}
}}}

Bob then [:Pull:pulls] Alice's repo to synchronize. This copies all of Alice's changes into Bob's repo:

{{{#!dot
digraph {
   label="Bob's Repo"
   rankdir = LR
   node [shape=box]
   a->b->c->d->e->f
   e [color=blue]
   f [color=blue]
   d->g
   g [color=red;label="g (tip)"]
}
}}}

Because Alice's '''g''' is the newest head in Bob's repository, it's now the '''tip'''. Bob then does a [:Merge:merge] which combines the last change he was working on ('''f''') with the tip, commits the result, and ends up with:

{{{#!dot
digraph {
   label="Bob's Repo"
   rankdir = LR
   node [shape=box]
   a->b->c->d->e->f
   e [color=blue]
   f [color=blue]
   d->g
   g [color=red]
   f->h
   g->h
   h [color=green;label="h (tip)"]
}
}}}

Now if Alice '''pulls''' from Bob, she will get Bob's changes e, f, and h, and they will be fully synchronized:

{{{#!dot
digraph {
   label="Alice's Repo"
   rankdir = LR
   node [shape=box]
   a->b->c->d->g
   d->e->f
   e [color=blue]
   f [color=blue]
   g [color=red]
   f->h
   g->h
   h [color=green;label="h (tip)"]
}
}}}

== A Decentralized System ==

Mercurial is a completely decentralized system, and thus has no internal notion of a central repository. Thus users are free to define their own topologies for sharing changes (see CommunicatingChanges):

{{{#!dot
digraph {
   Alice -> Central
   Central -> Alice
   Bob -> Central
   Alice -> Bob
   Alice -> Carl
   Carl -> Central
   Bob -> Carl
   Carl -> Bob
   "Carl's Laptop" -> Carl
   Carl -> "Carl's Laptop"
   "Carl's Laptop" -> Central
   Central [style=fill;color=blue;label="Main Public Repo"]
   label="A Mercurial Network"
}
}}}

For a hands-on introduction to using Mercurial, see the ["Tutorial"].

머큐리얼에 대한 이해

머큐리얼 초보자에게 어려울 수 있는 분산형 개발 모델이다. 이 페이지는 기초적인 개념을 설명한다. 한단계씩 따라해 보려면 ["KoreanTutorial"]를 참고하라.

(Translations: [:BrazilianPortugueseUnderstandingMercurial:Brazilian Portuguese], [:ChineseUnderstandingMercurial:Chinese], [:FrenchUnderstandingMercurial:French], [:GermanUnderstandingMercurial:German], [:ItalianUnderstandingMercurial:Italian], [:JapaneseUnderstandingMercurial:Japanese], [:KoreanUnderstandingMercurial:Korean], [:SpanishUnderstandingMercurial:Spanish] )

TableOfContents

Repository에 있는 것들

머큐리얼의 [:Repository:repositories]에는 store과 함께 [:WorkingDirectory:working directory]가 있다:

store에는 프로젝트에 대한 완전한 이력이 남아 있다. 이러한 이력을 중앙 한곳에만 가지고 있는 전통적인 [:SCM:SCMs]과는 달리 모든 working directory는 이력에 대한 복사본을 쌍으로 가지고 있다. 이것은 병행적으로 개발하는 것을 가능케 한다.

working directory는 편집을 위한 준비로 특정 시점에(예를 들어 rev 2) 프로젝트의 파일의 복사본을 포함하고 있다. 왜냐하면 같이 포함되어 있는 [:Tag:tags]와 ignore files는 revision-controlled이기 때문이다.

변경사항 Commit 하기

[:Commit:commit]을 할때, working directory의 상태는 새로운 [:Revision:revision]으로 기록 되어진 그것의 [:Parent:부모] 와 관련이 있다.

revision 4는 working directory에 있는 revision이었던 revision 2의 branch임을 주의하라. 이제 revision 4는 working directory의 parent이다.

Revisions, Changesets, Heads, and Tip

Mercurial groups related changes to multiple files into single atomic [:ChangeSet:changesets], which are revisions of the whole project. These each get a sequential [:RevisionNumber:revision number]. Because Mercurial allows distributed parallel development, these revision numbers may disagree between users. So Mercurial also assigns each revision a global [:ChangeSetID:changeset ID]. Changeset IDs are 40-digit hexadecimal numbers, but they can be abbreviated to any unambiguous prefix, like "e38487".

Branches and [:Merge:merges] in the revision history can occur at any point. Each unmerged branch creates a new [:Head:head] of the revision history. Here, revisions 5 and 6 are heads. Mercurial considers revision 6 to be the [:Tip:tip] of the repository, the head with the highest revision number.

Cloning, Making Changes, Merging, and Pulling

Let's start with a user Alice, who has a store that looks like:

Bob [:Clone:clones] this repo, and ends up with a complete copy of Alice's store (though his working directory is independent!):

Bob then [:Commit:commits] a couple changes:

Alice then makes her own change in parallel:

Bob then [:Pull:pulls] Alice's repo to synchronize. This copies all of Alice's changes into Bob's repo:

Because Alice's g is the newest head in Bob's repository, it's now the tip. Bob then does a [:Merge:merge] which combines the last change he was working on (f) with the tip, commits the result, and ends up with:

Now if Alice pulls from Bob, she will get Bob's changes e, f, and h, and they will be fully synchronized:

A Decentralized System

Mercurial is a completely decentralized system, and thus has no internal notion of a central repository. Thus users are free to define their own topologies for sharing changes (see CommunicatingChanges):

For a hands-on introduction to using Mercurial, see the ["Tutorial"].

KoreanUnderstandingMercurial (last edited 2012-11-11 13:32:26 by abuehl)