# HG changeset patch # User Yoshiki Yazawa # Date 1224490967 -32400 # Node ID 427e0fed6d5edfa1ac2bf010da67716fde78752c # Parent 1b372620963a8991582014e5e1615853c9549182 started tour-merge.tex diff -r 1b372620963a -r 427e0fed6d5e ja/todo.txt --- a/ja/todo.txt Mon Oct 20 15:22:06 2008 +0900 +++ b/ja/todo.txt Mon Oct 20 17:22:47 2008 +0900 @@ -16,6 +16,6 @@ srcinstall.tex 100% template.tex 100% tour-basic.tex -tour-merge.tex +tour-merge.tex 10% undo.tex 100% cmdref.tex 100% diff -r 1b372620963a -r 427e0fed6d5e ja/tour-merge.tex --- a/ja/tour-merge.tex Mon Oct 20 15:22:06 2008 +0900 +++ b/ja/tour-merge.tex Mon Oct 20 17:22:47 2008 +0900 @@ -1,116 +1,198 @@ -\chapter{A tour of Mercurial: merging work} +%\chapter{A tour of Mercurial: merging work} +\chapter{Mercurialツアー: マージ} \label{chap:tour-merge} -We've now covered cloning a repository, making changes in a -repository, and pulling or pushing changes from one repository into -another. Our next step is \emph{merging} changes from separate -repositories. +%We've now covered cloning a repository, making changes in a +%repository, and pulling or pushing changes from one repository into +%another. Our next step is \emph{merging} changes from separate +%repositories. + +我々は既にリポジトリのクローン,リポジトリに対する変更,1つのリポジトリか +らのpullと別の1つのリポジトリに対するpushを行った.次のステップは別のリポ +ジトリから変更を\emph{マージ}することである. -\section{Merging streams of work} +%\section{Merging streams of work} +\section{複数の作業結果をマージする} + +%Merging is a fundamental part of working with a distributed revision +%control tool. + +マージは分散リビジョンコントロールツールでの作業において不可欠の部分であ +る. -Merging is a fundamental part of working with a distributed revision -control tool. \begin{itemize} -\item Alice and Bob each have a personal copy of a repository for a - project they're collaborating on. Alice fixes a bug in her - repository; Bob adds a new feature in his. They want the shared - repository to contain both the bug fix and the new feature. -\item I frequently work on several different tasks for a single - project at once, each safely isolated in its own repository. - Working this way means that I often need to merge one piece of my - own work with another. +%\item Alice and Bob each have a personal copy of a repository for a + +% project they're collaborating on. Alice fixes a bug in her +% repository; Bob adds a new feature in his. They want the shared +% repository to contain both the bug fix and the new feature. + \item アリスとボブは共同作業しているプロジェクトのリポジトリコピーを各々 +持っている.アリスは自分のリポジトリでバグを修正し,ボブは彼のリポジトリ +で新機能を追加した.彼らはバグ修正と新機能の両方を持つリポジトリを共有し +たいと考えている. + +%\item I frequently work on several different tasks for a single +% project at once, each safely isolated in its own repository. +% Working this way means that I often need to merge one piece of my +% own work with another. + \item 私は一つのプロジェクトの別々のタスクに対して同時に作業を行うことを + よく行っている.このような作業スタイルでは,自分の作業の一つから別 + の作業の一つへ結果をマージしたいと思うことがしばしばある. + \end{itemize} -Because merging is such a common thing to need to do, Mercurial makes -it easy. Let's walk through the process. We'll begin by cloning yet -another repository (see how often they spring up?) and making a change -in it. +%Because merging is such a common thing to need to do, Mercurial makes +%it easy. Let's walk through the process. We'll begin by cloning yet +%another repository (see how often they spring up?) and making a change +%in it. + +上で述べたようにマージを行いたい状況はとても多いため, Mercurialではマー +ジを簡単に行えるようになっている.まず別のリポジトリをクローンし,変更を +加えるところから始めよう. \interaction{tour.merge.clone} -We should now have two copies of \filename{hello.c} with different -contents. The histories of the two repositories have also diverged, -as illustrated in figure~\ref{fig:tour-merge:sep-repos}. + +%We should now have two copies of \filename{hello.c} with different +%contents. The histories of the two repositories have also diverged, +%as illustrated in figure~\ref{fig:tour-merge:sep-repos}. + +今,内容の異なった2つの\filename{hello.c}がある. 2つのリポジトリの履歴は +図~\ref{fig:tour-merge:sep-repos}に示すように分かれている. \interaction{tour.merge.cat} \begin{figure}[ht] \centering \grafix{tour-merge-sep-repos} - \caption{Divergent recent histories of the \dirname{my-hello} and - \dirname{my-new-hello} repositories} +% \caption{Divergent recent histories of the \dirname{my-hello} and +% \dirname{my-new-hello} repositories} + \caption{\dirname{my-hello}リポジトリと\dirname{my-new-hello}リポジト + リの履歴の差異} \label{fig:tour-merge:sep-repos} \end{figure} -We already know that pulling changes from our \dirname{my-hello} -repository will have no effect on the working directory. +%We already know that pulling changes from our \dirname{my-hello} +%repository will have no effect on the working directory. +既に\dirname{my-hello}リポジトリからのpullはワーキングディレクトリに何の +影響も与えないことを学んだ. \interaction{tour.merge.pull} -However, the \hgcmd{pull} command says something about ``heads''. +%However, the \hgcmd{pull} command says something about ``heads''. +しかし\hgcmd{pull}コマンドは``heads''についてメッセージを表示する. -\subsection{Head changesets} +%\subsection{Head changesets} +\subsection{Headチェンジセット} -A head is a change that has no descendants, or children, as they're -also known. The tip revision is thus a head, because the newest -revision in a repository doesn't have any children, but a repository -can contain more than one head. +%A head is a change that has no descendants, or children, as they're +%also known. The tip revision is thus a head, because the newest +%revision in a repository doesn't have any children, but a repository +%can contain more than one head. +headは子孫や子を持たない変更である.リポジトリの最新のリビジョンは子を持 +たないため,tipリビジョンはすなわちheadである.一方でリポジトリは複数の +headを持ち得る. \begin{figure}[ht] \centering \grafix{tour-merge-pull} - \caption{Repository contents after pulling from \dirname{my-hello} into - \dirname{my-new-hello}} +% \caption{Repository contents after pulling from \dirname{my-hello} into +% \dirname{my-new-hello}} + \caption{\dirname{my-hello}から\dirname{my-new-hello}へpullしたあとの + リポジトリの内容} \label{fig:tour-merge:pull} \end{figure} -In figure~\ref{fig:tour-merge:pull}, you can see the effect of the -pull from \dirname{my-hello} into \dirname{my-new-hello}. The history -that was already present in \dirname{my-new-hello} is untouched, but a -new revision has been added. By referring to -figure~\ref{fig:tour-merge:sep-repos}, we can see that the -\emph{changeset ID} remains the same in the new repository, but the -\emph{revision number} has changed. (This, incidentally, is a fine -example of why it's not safe to use revision numbers when discussing -changesets.) We can view the heads in a repository using the -\hgcmd{heads} command. +%In figure~\ref{fig:tour-merge:pull}, you can see the effect of the +%pull from \dirname{my-hello} into \dirname{my-new-hello}. The history +%that was already present in \dirname{my-new-hello} is untouched, but a +%new revision has been added. By referring to +%figure~\ref{fig:tour-merge:sep-repos}, we can see that the +%\emph{changeset ID} remains the same in the new repository, but the +%\emph{revision number} has changed. (This, incidentally, is a fine +%example of why it's not safe to use revision numbers when discussing +%changesets.) We can view the heads in a repository using the +%\hgcmd{heads} command. +%\interaction{tour.merge.heads} + +図~\ref{fig:tour-merge:pull}に\dirname{my-hello}から +\dirname{my-new-hello}へpullを行った効果を示す. \dirname{my-new-hello}に +既に存在した履歴は変更されず,新たにリビジョンが追加される. +figure~\ref{fig:tour-merge:sep-repos}を見ると,新しいリポジトリにも +\emph{changeset ID}が残っていること,\emph{リビジョン番号}が変更されてい +ることが分かる. (これは同時にチェンジセットについて論じる際にリビジョン +番号を用いるのが安全でないことの例になっている.)リポジトリ内にあるhead +は\hgcmd{heads}によって見ることができる. \interaction{tour.merge.heads} -\subsection{Performing the merge} +%\subsection{Performing the merge} +\subsection{マージを実行する} -What happens if we try to use the normal \hgcmd{update} command to -update to the new tip? +%What happens if we try to use the normal \hgcmd{update} command to +%update to the new tip? +%\interaction{tour.merge.update} + +新しいtipへ更新するために\hgcmd{update}を使った場合何が起きるか? \interaction{tour.merge.update} -Mercurial is telling us that the \hgcmd{update} command won't do a -merge; it won't update the working directory when it thinks we might -be wanting to do a merge, unless we force it to do so. Instead, we -use the \hgcmd{merge} command to merge the two heads. + +%Mercurial is telling us that the \hgcmd{update} command won't do a +%merge; it won't update the working directory when it thinks we might +%be wanting to do a merge, unless we force it to do so. Instead, we +%use the \hgcmd{merge} command to merge the two heads. +%\interaction{tour.merge.merge} + +Mercurialは\hgcmd{update}コマンドがマージを行わないとメッセージを表示す +る. \hgcmd{update}コマンドは,マージが必要と考えられる場合は,ユーザが +(オプションによって)強制しない限りワーキングディレクトリを更新しない. +一方,\hgcmd{merge}コマンドは2つのヘッドのマージを行う. \interaction{tour.merge.merge} \begin{figure}[ht] \centering \grafix{tour-merge-merge} - \caption{Working directory and repository during merge, and - following commit} +% \caption{Working directory and repository during merge, and +% following commit} + \caption{マージ中のワーキングディレクトリとリポジトリおよび後続のコミッ + ト} \label{fig:tour-merge:merge} \end{figure} -This updates the working directory so that it contains changes from -\emph{both} heads, which is reflected in both the output of -\hgcmd{parents} and the contents of \filename{hello.c}. -\interaction{tour.merge.parents} +%This updates the working directory so that it contains changes from +%\emph{both} heads, which is reflected in both the output of +%\hgcmd{parents} and the contents of \filename{hello.c}. +%\interaction{tour.merge.parents} + +この操作によって\hgcmd{parents}と\filename{hello.c}の出力の双方を反映する +\emph{双方の}headからの変更を含むようにワーキングディレクトリが更新される. -\subsection{Committing the results of the merge} +%\subsection{Committing the results of the merge} +\subsection{マージ結果をコミットする} -Whenever we've done a merge, \hgcmd{parents} will display two parents -until we \hgcmd{commit} the results of the merge. +%Whenever we've done a merge, \hgcmd{parents} will display two parents +%until we \hgcmd{commit} the results of the merge. +%\interaction{tour.merge.commit} + +マージを行うと,マージの結果を\hgcmd{commit}するまで,\hgcmd{parents}は2 +つのペアレントを表示する. \interaction{tour.merge.commit} -We now have a new tip revision; notice that it has \emph{both} of -our former heads as its parents. These are the same revisions that -were previously displayed by \hgcmd{parents}. + +%We now have a new tip revision; notice that it has \emph{both} of +%our former heads as its parents. These are the same revisions that +%were previously displayed by \hgcmd{parents}. +%\interaction{tour.merge.tip} + +新しいtipリビジョンは以前のヘッド\emph{両方}を親として持つ.これらは +\hgcmd{parents}コマンドで表示したのと同じリビジョンである. \interaction{tour.merge.tip} -In figure~\ref{fig:tour-merge:merge}, you can see a representation of -what happens to the working directory during the merge, and how this -affects the repository when the commit happens. During the merge, the -working directory has two parent changesets, and these become the -parents of the new changeset. + +%In figure~\ref{fig:tour-merge:merge}, you can see a representation of +%what happens to the working directory during the merge, and how this +%affects the repository when the commit happens. During the merge, the +%working directory has two parent changesets, and these become the +%parents of the new changeset. -\section{Merging conflicting changes} +図~\ref{fig:tour-merge:merge}で,マージの間にワーキングディレクトリに何が +起き,コミットした時にリポジトリにどう影響するのかを見ることができる. +マージの間,ワーキングディレクトリは2つの親チェンジセットを持ち,これらは +新しいチェンジセットの両親となる. + +%\section{Merging conflicting changes} +\section{コンフリクトのある変更をマージする} Most merges are simple affairs, but sometimes you'll find yourself merging changes where each modifies the same portions of the same @@ -145,7 +227,8 @@ instead of \command{hgmerge}, by setting the \envar{HGMERGE} environment variable to the name of your preferred program. -\subsection{Using a graphical merge tool} +%\subsection{Using a graphical merge tool} +\subsection{グラフィカルマージツールの使用} My preferred graphical merge tool is \command{kdiff3}, which I'll use to describe the features that are common to graphical file merging @@ -175,7 +258,8 @@ \begin{figure}[ht] \centering \grafix{kdiff3} - \caption{Using \command{kdiff3} to merge versions of a file} +% \caption{Using \command{kdiff3} to merge versions of a file} + \caption{ファイルの複数リビジョンを\command{kdiff3}を使ってマージする} \label{fig:tour-merge:kdiff3} \end{figure} @@ -190,7 +274,8 @@ files containing plain text, while a few are aimed at specialised file formats (generally XML). -\subsection{A worked example} +%\subsection{A worked example} +\subsection{実行例} In this example, we will reproduce the file modification history of figure~\ref{fig:tour-merge:conflict} above. Let's begin by creating a @@ -231,7 +316,8 @@ of our merge: \interaction{tour-merge-conflict.commit} -\section{Simplifying the pull-merge-commit sequence} +%\section{Simplifying the pull-merge-commit sequence} +\section{pull-merge-commit手順を簡単にする} \label{sec:tour-merge:fetch} The process of merging changes as outlined above is straightforward, @@ -277,7 +363,7 @@ is in the standard distribution, Mercurial knows where to search for it.) -%%% Local Variables: +%%% Local Variables: %%% mode: yatex %%% TeX-master: "00book" -%%% End: +%%% End: