# HG changeset patch # User Yoshiki Yazawa # Date 1206565654 -32400 # Node ID 5357ca303e85fb9668baef0325989added2e4558 # Parent 5b5aeb1c5f2f1d6ef4276bc31d4201ab37a05849 more branch.tex diff -r 5b5aeb1c5f2f -r 5357ca303e85 ja/branch.tex --- a/ja/branch.tex Thu Mar 27 02:29:56 2008 +0900 +++ b/ja/branch.tex Thu Mar 27 06:07:34 2008 +0900 @@ -390,96 +390,169 @@ \interaction{branch-repo.new} %\section{Don't repeat yourself: merging across branches} -\section{手で繰り返すべきではない:ブランチ間でのマージ} +\section{手で繰り返さないこと:ブランチ間でのマージ} + +%In many cases, if you have a bug to fix on a maintenance branch, the +%chances are good that the bug exists on your project's main branch +%(and possibly other maintenance branches, too). It's a rare developer +%who wants to fix the same bug multiple times, so let's look at a few +%ways that Mercurial can help you to manage these bugfixes without +%duplicating your work. -In many cases, if you have a bug to fix on a maintenance branch, the -chances are good that the bug exists on your project's main branch -(and possibly other maintenance branches, too). It's a rare developer -who wants to fix the same bug multiple times, so let's look at a few -ways that Mercurial can help you to manage these bugfixes without -duplicating your work. +メンテナンスブランチで修正すべきバグがあるとき,多くの場合,メインブラン +チにそのバグがある可能性は高い.(さらに他のメンテナンスブランチにおいて +も.)バグの修正を何度も繰り返したいと思う開発者はまずいない.そこでバグ +修正を繰り返す代わりのではなく,Mercurialで解決できるいくつかの方法を見 +てみることにしよう. -In the simplest instance, all you need to do is pull changes from your -maintenance branch into your local clone of the target branch. +%In the simplest instance, all you need to do is pull changes from your +%maintenance branch into your local clone of the target branch. +%\interaction{branch-repo.pull} +%You'll then need to merge the heads of the two branches, and push back +%to the main branch. +%\interaction{branch-repo.merge} + +最も簡単なのは,メンテナンスブランチから変更をターゲットブランチのローカ +ルクローンにpullする方法である. \interaction{branch-repo.pull} -You'll then need to merge the heads of the two branches, and push back -to the main branch. +その後2つのブランチのヘッド同士をマージし,メインブランチへプッシュする. \interaction{branch-repo.merge} %\section{Naming branches within one repository} \section{1つのリポジトリ内でのブランチの命名} -In most instances, isolating branches in repositories is the right -approach. Its simplicity makes it easy to understand; and so it's -hard to make mistakes. There's a one-to-one relationship between -branches you're working in and directories on your system. This lets -you use normal (non-Mercurial-aware) tools to work on files within a -branch/repository. +%In most instances, isolating branches in repositories is the right +%approach. Its simplicity makes it easy to understand; and so it's +%hard to make mistakes. There's a one-to-one relationship between +%branches you're working in and directories on your system. This lets +%you use normal (non-Mercurial-aware) tools to work on files within a +%branch/repository. + +多くの場合,ブランチ毎に複数のリポジトリを用意し隔離するのは正しいアプロー +チである.これは単純なため把握が容易であり,失敗を犯す可能性が低い.作業 +しているブランチとディレクトリの間には1対1の関係がある.Mercurialを考慮し +ない通常のツールをブランチ/リポジトリ内のファイルに大して使うことも可能 +である. -If you're more in the ``power user'' category (\emph{and} your -collaborators are too), there is an alternative way of handling -branches that you can consider. I've already mentioned the -human-level distinction between ``small picture'' and ``big picture'' -branches. While Mercurial works with multiple ``small picture'' -branches in a repository all the time (for example after you pull -changes in, but before you merge them), it can \emph{also} work with -multiple ``big picture'' branches. +%If you're more in the ``power user'' category (\emph{and} your +%collaborators are too), there is an alternative way of handling +%branches that you can consider. I've already mentioned the +%human-level distinction between ``small picture'' and ``big picture'' +%branches. While Mercurial works with multiple ``small picture'' +%branches in a repository all the time (for example after you pull +%changes in, but before you merge them), it can \emph{also} work with +%multiple ``big picture'' branches. + +あなたと(あなたの協力者が\emph{共に})``パワーユーザ''以上のカテゴリに属 +すなら,ブランチを取り扱う別の方法も考えられる.すでに``局所的なモデル'' +と``大局的なモデル''という,区別について触れた.Mercurialは,複数の``局所 +的な''ブランチ(たとえば変更をpullしてマージしていない場合など)用いるこ +とができる一方で,複数の``大局的な''ブランチを用いること\emph{も}できる. + +%The key to working this way is that Mercurial lets you assign a +%persistent \emph{name} to a branch. There always exists a branch +%named \texttt{default}. Even before you start naming branches +%yourself, you can find traces of the \texttt{default} branch if you +%look for them. -The key to working this way is that Mercurial lets you assign a -persistent \emph{name} to a branch. There always exists a branch -named \texttt{default}. Even before you start naming branches -yourself, you can find traces of the \texttt{default} branch if you -look for them. +この方法を用いる際の鍵は,Mercurialによってブランチに永続的な\emph{名前} +を付けることである.ブランチに名前を付ける前でも,\texttt{default}ブラン +チのトレースを見ることができる. + +%As an example, when you run the \hgcmd{commit} command, and it pops up +%your editor so that you can enter a commit message, look for a line +%that contains the text ``\texttt{HG: branch default}'' at the bottom. +%This is telling you that your commit will occur on the branch named +%\texttt{default}. + +例として,\hgcmd{commit}コマンドを実行し,コミットメッセージを書くために +エディタが起動された時,最下部の``\texttt{HG: branch default}''という行 +を見てほしい.この行はコミットが\texttt{default}という名前のブランチに対 +して行われることを示している. -As an example, when you run the \hgcmd{commit} command, and it pops up -your editor so that you can enter a commit message, look for a line -that contains the text ``\texttt{HG: branch default}'' at the bottom. -This is telling you that your commit will occur on the branch named -\texttt{default}. +%To start working with named branches, use the \hgcmd{branches} +%command. This command lists the named branches already present in +%your repository, telling you which changeset is the tip of each. +%\interaction{branch-named.branches} +%Since you haven't created any named branches yet, the only one that +%exists is \texttt{default}. -To start working with named branches, use the \hgcmd{branches} -command. This command lists the named branches already present in -your repository, telling you which changeset is the tip of each. +名前付きブランチを使うにあたって,まず\hgcmd{branches}を使い,リポジトリ +内にすでに存在する名前付きブランチを列挙することから始める.このコマンド +によってそれぞれのブランチのtipになっているチェンジセットがわかる. \interaction{branch-named.branches} -Since you haven't created any named branches yet, the only one that -exists is \texttt{default}. +ここではまだ名前付きブランチを作っていないので,\texttt{default}ブランチ +だけが存在する. -To find out what the ``current'' branch is, run the \hgcmd{branch} -command, giving it no arguments. This tells you what branch the -parent of the current changeset is on. +%To find out what the ``current'' branch is, run the \hgcmd{branch} +%command, giving it no arguments. This tells you what branch the +%parent of the current changeset is on. +%\interaction{branch-named.branch} + +現在のブランチが何なのかを知るためには,\hgcmd{branch}コマンドを引数なし +で実行する.このコマンドで現在のチェンジセットの親ブランチがわかる. \interaction{branch-named.branch} -To create a new branch, run the \hgcmd{branch} command again. This -time, give it one argument: the name of the branch you want to create. +%To create a new branch, run the \hgcmd{branch} command again. This +%time, give it one argument: the name of the branch you want to create. +%\interaction{branch-named.create} + +新しいブランチを作るのにも\hgcmd{branch}コマンドを使う.この場合は,作成 +したいブランチの名前を引数として渡す. \interaction{branch-named.create} -After you've created a branch, you might wonder what effect the -\hgcmd{branch} command has had. What do the \hgcmd{status} and -\hgcmd{tip} commands report? +%After you've created a branch, you might wonder what effect the +%\hgcmd{branch} command has had. What do the \hgcmd{status} and +%\hgcmd{tip} commands report? +%\interaction{branch-named.status} +%Nothing has changed in the working directory, and there's been no new +%history created. As this suggests, running the \hgcmd{branch} command +%has no permanent effect; it only tells Mercurial what branch name to +%use the \emph{next} time you commit a changeset. + +ブランチを作った後で\hgcmd{branch}コマンドがどのような効果を持っているの +か分からないかもしれない.\hgcmd{status}コマンドと\hgcmd{tip}コマンドは +それぞれ何を表示するだろうか? \interaction{branch-named.status} -Nothing has changed in the working directory, and there's been no new -history created. As this suggests, running the \hgcmd{branch} command -has no permanent effect; it only tells Mercurial what branch name to -use the \emph{next} time you commit a changeset. +ワーキングディレクトリ内では何も変化は起きず,何のヒストリも生成されてい +ない.これから分かるように,\hgcmd{branch}コマンドを実行しても,永続的な +効果は何も起きない.このコマンドは\emph{次の}チェンジセットのコミットが +どのブランチに対して行われるかをMercurialコマンドに示すのに使われる. -When you commit a change, Mercurial records the name of the branch on -which you committed. Once you've switched from the \texttt{default} -branch to another and committed, you'll see the name of the new branch -show up in the output of \hgcmd{log}, \hgcmd{tip}, and other commands -that display the same kind of output. +%When you commit a change, Mercurial records the name of the branch on +%which you committed. Once you've switched from the \texttt{default} +%branch to another and committed, you'll see the name of the new branch +%show up in the output of \hgcmd{log}, \hgcmd{tip}, and other commands +%that display the same kind of output. +%\interaction{branch-named.commit} +%The \hgcmd{log}-like commands will print the branch name of every +%changeset that's not on the \texttt{default} branch. As a result, if +%you never use named branches, you'll never see this information. + +変更をコミットする時,Mercurialはコミットするの対象になるブランチの名前 +を記録する.ひとたび\texttt{default}から他へ変更すれば,新しいブランチ名 +が\hgcmd{log}や\hgcmd{tip}の出力に含まれるのが見て取れるだろう. \interaction{branch-named.commit} -The \hgcmd{log}-like commands will print the branch name of every -changeset that's not on the \texttt{default} branch. As a result, if -you never use named branches, you'll never see this information. +\hgcmd{log}のようなコマンドは,\texttt{default}ブランチ以外に属するすべて +のチェンジセットに対してブランチ名を表示する.ブランチに名前を付けていな +い場合はこの出力を目にすることはない. -Once you've named a branch and committed a change with that name, -every subsequent commit that descends from that change will inherit -the same branch name. You can change the name of a branch at any -time, using the \hgcmd{branch} command. +%Once you've named a branch and committed a change with that name, +%every subsequent commit that descends from that change will inherit +%the same branch name. You can change the name of a branch at any +%time, using the \hgcmd{branch} command. +%\interaction{branch-named.rebranch} +%In practice, this is something you won't do very often, as branch +%names tend to have fairly long lifetimes. (This isn't a rule, just an +%observation.) + +ブランチに名前を付け,その名前を使って変更のコミットを行うと,以後に続く +全てのコミットは同じ名前を持つ.名前の変更は\hgcmd{branch}コマンドを使うこ +とではいつでも可能だ. \interaction{branch-named.rebranch} -In practice, this is something you won't do very often, as branch -names tend to have fairly long lifetimes. (This isn't a rule, just an -observation.) +実用においては,ブランチ名はかなり長い期間使われる傾向があり,変更は頻繁 +には行われない.(これは法則と言えるようなものではなく,単なる観測結果で +ある.) %\section{Dealing with multiple named branches in a repository} \section{リポジトリ内で複数の名前の付いたブランチの取り扱い}