# HG changeset patch # User Yoshiki Yazawa # Date 1245323084 -32400 # Node ID 1a30d2627512f9aabdbd9a412ccb1eda29f9df09 # Parent 7107b79427a34c74b1964f05d7bd7e580bffeb08 Propagate 2ff0a43f1152 Update ch03 diff -r 7107b79427a3 -r 1a30d2627512 ja/concepts.tex --- a/ja/concepts.tex Thu Jun 18 19:11:36 2009 +0900 +++ b/ja/concepts.tex Thu Jun 18 20:04:44 2009 +0900 @@ -2,24 +2,27 @@ \chapter{舞台裏} \label{chap:concepts} -%Unlike many revision control systems, the concepts upon which -%Mercurial is built are simple enough that it's easy to understand how -%the software really works. Knowing this certainly isn't necessary, -%but I find it useful to have a ``mental model'' of what's going on. +%Unlike many revision control systems, the concepts upon which Mercurial +%is built are simple enough that it's easy to understand how the software +%really works. Knowing these details certainly isn't necessary, so it is +%certainly safe to skip this chapter. However, I think you will get more +%out of the software with a ``mental model'' of what's going on. 多くのリビジョンコントロールシステムと違って, Mercurialの動作の基本となっ -ているコンセプトを理解することは容易い. -これを理解することは必ずしも必要ではないが,筆者は,何が起きているのかに -ついてモデルを意識していることは有用であると考えている. +ている概念を理解することは容易い.これらの詳細を理解することは必ずしも必 +要ではなく,この章を飛ばしても差し支えない.しかし筆者は,ソフトウェアを +よりよく使う上で何が起きているのかについてモデルを意識していることは有用 +であると考えている. -%This understanding gives me confidence that Mercurial has been -%carefully designed to be both \emph{safe} and \emph{efficient}. And -%just as importantly, if it's easy for me to retain a good idea of what -%the software is doing when I perform a revision control task, I'm less -%likely to be surprised by its behaviour. +%Being able to understand what's going on behind the scenes gives me +%confidence that Mercurial has been carefully designed to be both +%\emph{safe} and \emph{efficient}. And just as importantly, if it's easy +%for me to retain a good idea of what the software is doing when I +%perform a revision control task, I'm less likely to be surprised by its +%behaviour. -このことを理解した後で,筆者はMercurialが\emph{安全}と\emph{効率}を実現す -るように注意深く設計されていると確信するに至った. +舞台裏で何が起こっているのか理解できると,筆者はMercurialが\emph{安全}と +\emph{効率}を実現するように注意深く設計されていると確信することができた. また,重要な点として,リビジョンコントロールの操作を行う際にソフトウェア が何をするのかを記憶に留めておくことによって,不意の挙動で驚くことが少な くなった. @@ -583,12 +586,13 @@ % commit afterwards, you'll thus create a new head, because your % working directory isn't synced to whatever the current tip is. % -% I put the word ``error'' in quotes because all that you need to do -% to rectify this situation is \hgcmd{merge}, then \hgcmd{commit}. In -% other words, this almost never has negative consequences; it just -% surprises people. I'll discuss other ways to avoid this behaviour, -% and why Mercurial behaves in this initially surprising way, later -% on. +% I put the word ``error'' in quotes because all that you need to do to +% rectify this situation is \hgcmd{merge}, then \hgcmd{commit}. In other +% words, this almost never has negative consequences; it's just something +% of a surprise for newcomers. I'll discuss other ways to avoid this +% behaviour, and why Mercurial behaves in this initially surprising way, +% later on. + %\end{note} \begin{note} @@ -596,19 +600,19 @@ い.それは\hgcmd{pull}コマンドをオプションなしで実行することである.デフォ ルトでは\hgcmd{pull}はワーキングディレクトリの更新を\emph{行わない}.その ため,リポジトリには新しいチェンジセットが到着しているのにワーキングディ -レクトリは前回pullしたチェンジセットのままである.ここでなんらかの変更を -行ってコミットしようとすると,ワーキングディレクトリが現在のtipに同期して -いないため,新たなヘッドを作ることになってしまう. +レクトリは前回pullしたチェンジセットのままである.ここで何らかの変更を行っ +てコミットしようとすると,ワーキングディレクトリが現在のtipに同期していな +いため,新たなヘッドを作ることになってしまう. ``エラー''という言葉を引用符で括ったのは,この状態は\hgcmd{merge}と \hgcmd{commit}だけで解消できるからだ.言い替えると,この状態はほとんどの -場合害をなすものではななく,単にユーザを驚かす程度のものである.この振舞 +場合害をなすものではななく,単に初心者を驚かす程度のものである.この振舞 を避ける別の方法や,なぜMercurialがこのように驚かせるような方法で動作する のかについては後ほど議論する. \end{note} -%\subsection{Merging heads} -\subsection{ヘッド間のマージ} +%\subsection{Merging changes +\subsection{変更のマージ} %When you run the \hgcmd{merge} command, Mercurial leaves the first %parent of the working directory unchanged, and sets the second parent @@ -707,6 +711,27 @@ を一度にマージすることは技術的には可能だが,マージによる混乱を引き起こ し,収拾がつかなくなる見込みが大きい. +\subsection{マージとリネーム} +%A surprising number of revision control systems pay little or no +%attention to a file's \emph{name} over time. For instance, it used to +%be common that if a file got renamed on one side of a merge, the changes +%from the other side would be silently dropped. + +驚くほど多くのリビジョンコントロールシステムが\emph{ファイル名}の変化に注 +意を払っていない.例えばマージの際,一方でファイルがリネームされていた場 +合,もう一方の変更は何の警告も無しに破棄されてしまう. + +%Mercurial records metadata when you tell it to perform a rename or +%copy. It uses this metadata during a merge to do the right thing in the +%case of a merge. For instance, if I rename a file, and you edit it +%without renaming it, when we merge our work the file will be renamed and +%have your edits applied. + +Mercurialはリネームやコピーを行う時にメタデータを記録し,マージを正しく行 +うために利用する.例えばあるユーザがファイルをリネームし,別のユーザがリ +ネームせずに同じファイルを編集したとすると,マージの際にファイルはリネー +ムされ,なおかつ編集内容も取り込む. + %\section{Other interesting design features} \section{設計の他の興味深い点}