# HG changeset patch # User Yoshiki Yazawa # Date 1245310990 -32400 # Node ID a958bf6d87ed9d5e11a3c692144a83c69edc55d2 # Parent 5cb09396dc35e6b2721cebccc273a30a6dec4b96 Propagate c44d5854620b Fix up chapter 1. diff -r 5cb09396dc35 -r a958bf6d87ed ja/tour-basic.tex --- a/ja/tour-basic.tex Thu Jun 18 16:41:21 2009 +0900 +++ b/ja/tour-basic.tex Thu Jun 18 16:43:10 2009 +0900 @@ -14,8 +14,27 @@ ケージが提供されている.これを用いれば読者の計算機の上で直ちにMercurial を使うことができる. +\subsection{Windows} + +%The best version of Mercurial for Windows is TortoiseHg, which can be +%found at \url{http://bitbucket.org/tortoisehg/stable/wiki/Home}. This +%package has no external dependencies; it ``just works''. It +%provides both command line and graphical user interfaces. + +Windows向けMercurialの最も優れたバージョンであるTortoiseHgは, +\url{http://bitbucket.org/tortoisehg/stable/wiki/Home}で入手できる. +このパッケージは外部のパッケージへ依存せず,すぐに動作する.コマンドライ +ンインタフェースとグラフィカルユーザインタフェースの両方が利用できる. + +\subsection{Mac OS X} + +%Lee Cantey publishes an installer of Mercurial for Mac OS X at +% \url{http://mercurial.berkwood.com}. + +Lee CanteyはMac OS~X向けのMercurialインストーラを +\url{http://mercurial.berkwood.com}で配布している. + \subsection{Linux} - %Because each Linux distribution has its own packaging tools, policies, %and rate of development, it's difficult to give a comprehensive set of %instructions on how to install Mercurial binaries. The version of @@ -39,12 +58,12 @@ ようなグラフィカルなパッケージマネージャを用意している. \begin{itemize} -\item[Debian] +\item[Debian and Ubuntu] \begin{codesample4} apt-get install mercurial \end{codesample4} -\item[Fedora Core] +\item[Fedora and OpenSUSE] \begin{codesample4} yum install mercurial \end{codesample4} @@ -54,18 +73,6 @@ emerge mercurial \end{codesample4} -\item[OpenSUSE] - \begin{codesample4} - yum install mercurial - \end{codesample4} - -%\item[Ubuntu] Ubuntu's Mercurial package is based on Debian's. To -% install it, run the following command. -\item[Ubuntu] UbuntuのMercurial packageはDebianのものを元にしている.こ - れをインストールするためには次のコマンドを実行する. - \begin{codesample4} - apt-get install mercurial - \end{codesample4} % The Ubuntu package for Mercurial tends to lag behind the Debian % version by a considerable time margin (at the time of writing, seven % months), which in some cases will mean that on Ubuntu, you may run @@ -77,47 +84,10 @@ \subsection{Solaris} -%SunFreeWare, at \url{http://www.sunfreeware.com}, is a good source for a -%large number of pre-built Solaris packages for 32 and 64 bit Intel and -%Sparc architectures, including current versions of Mercurial. - -\url{http://www.sunfreeware.com}にあるSunFreeWareは,現行のMercurialを含 -む,32ビット及び64ビットのIntelとSparcアーキテクチャ用にビルドされた -Solarisパッケージの大規模なコレクションである. - -\subsection{Mac OS X} - -%Lee Cantey publishes an installer of Mercurial for Mac OS~X at -%\url{http://mercurial.berkwood.com}. This package works on both -%Intel-~and Power-based Macs. Before you can use it, you must install -%a compatible version of Universal MacPython~\cite{web:macpython}. This -%is easy to do; simply follow the instructions on Lee's site. - -Lee CanteyはMac OS~X向けのMercurialインストーラを -\url{http://mercurial.berkwood.com}で配布している.このパッケージは -Intel-~とPower-ベースのMac両方で動作する.これを使う前に,互換性のあるバー -ジョンのUniversal MacPython~\cite{web:macpython}をインストールする必要が -ある.インストールは簡単で,Leeのサイトにある手順に従うだけである. - -\subsection{Windows} - -%Lee Cantey also publishes an installer of Mercurial for Windows at -%\url{http://mercurial.berkwood.com}. This package has no external -%dependencies; it ``just works''. - -Lee CanteyはWindows向けのMercurialインストーラも -\url{http://mercurial.berkwood.com}で配布している.このパッケージは外部 -のソフトウェアに依存せず,単独で実行可能である. - -\begin{note} -% The Windows version of Mercurial does not automatically convert line -% endings between Windows and Unix styles. If you want to share work -% with Unix users, you must do a little additional configuration -% work. XXX Flesh this out. - WindowsバージョンのMercurialは,WindowsとUnixの間で行末の改行コードを自 - 動で変換しない.Unixユーザと作業を行いたい場合は,追加の設定を行う必要 - がある.XXX Flesh this out. -\end{note} +%SunFreeWare, at \url{http://www.sunfreeware.com}, provides prebuilt +%packages of Mercurial. +\url{http://www.sunfreeware.com}からビルド済みのMercurialパッケージが入 +手できる. %\section{Getting started} \section{Mercurialを使う} @@ -184,36 +154,49 @@ %\emph{Copying} a repository is just a little bit special. While you %could use a normal file copying command to make a copy of a %repository, it's best to use a built-in command that Mercurial -%provides. This command is called \hgcmd{clone}, because it creates an +%provides. This command is called \hgcmd{clone}, because it makes an %identical copy of an existing repository. %\interaction{tour.clone} -%If our clone succeeded, we should now have a local directory called -%\dirname{hello}. This directory will contain some files. -%\interaction{tour.ls} -%These files have the same contents and history in our repository as -%they do in the repository we cloned. リポジトリの\emph{コピー}はやや特殊である.通常のファイルコピーコマンドを 使ってリポジトリのコピーを作成することもできるが,Mercurialの組み込みコマ ンドを使ってコピーするのが一番良い.このコマンドは\hgcmd{clone}と呼ばれ, 既存のリポジトリの完全なコピーを作成する. \interaction{tour.clone} + +%One advantage of using \hgcmd{clone} is that, as we can see above, it +%lets us clone repositories over the network. Another is that it +%remembers where we cloned from, which we'll find useful soon when we +%want to fetch new changes from another repository. + +\hgcmd{clone}コマンドを使う利点の一つは,上で見たようにリポジトリをネット +ワーク越しにクローンできる点である.またもう一点,このコマンドはどこから +クローンしたのかを記録するため,新たな変更を別のリポジトリから取得しよう +とする際に便利である. + +%If our clone succeeded, we should now have a local directory called +%\dirname{hello}. This directory will contain some files. +%\interaction{tour.ls} +%These files have the same contents and history in our repository as +%they do in the repository we cloned. + クローンが成功すると\dirname{hello}というローカルディレクトリができる. このディレクトリにはオリジナルと同一のファイルが含まれる. \interaction{tour.ls} これらのファイルはクローンしたリポジトリ内と全く同じ内容と履歴を持ってい る. -%Every Mercurial repository is complete, self-contained, and -%independent. It contains its own private copy of a project's files -%and history. A cloned repository remembers the location of the +%Every Mercurial repository is complete, self-contained, and independent. +%It contains its own private copy of a project's files and history. As we +%just mentioned, A cloned repository remembers the location of the %repository it was cloned from, but it does not communicate with that %repository, or any other, unless you tell it to. 全てのMercurialリポジトリは完全かつ自己充足的で独立である.リポジトリはプ -ロジェクトに属すファイルのプライベートコピーと履歴を持つ.クローンされた -リポジトリはクローン元のリポジトリの場所を記憶しているが,ユーザが指示し -ない限り,そのリポジトリや他のリポジトリと通信を行うことはない. +ロジェクトに属すファイルのプライベートコピーと履歴を持つ.今述べたよう +に,クローンされたリポジトリはクローン元のリポジトリの場所を記憶している +が,ユーザが指示しない限り,そのリポジトリや他のリポジトリと通信を行うこ +とはない. %What this means for now is that we're free to experiment with our %repository, safe in the knowledge that it's a private ``sandbox'' that @@ -264,15 +247,15 @@ %One of the first things we might want to do with a new, unfamiliar %repository is understand its history. The \hgcmd{log} command gives -%us a view of history. +%us a view of the history of changes in the repository. %\interaction{tour.log} %By default, this command prints a brief paragraph of output for each %change to the project that was recorded. In Mercurial terminology, we %call each of these recorded events a \emph{changeset}, because it can %contain a record of changes to several files. -未知のリポジトリに対してまずしようと思うことは,その履歴を知ることだろう. -履歴は\hgcmd{log}コマンドで見ることができる. +未知のリポジトリに対してまずしようと思うことは,そのリポジトリでの変更の +履歴を知ることだろう.履歴は\hgcmd{log}コマンドで見ることができる. \interaction{tour.log} デフォルトでは,このコマンドはプロジェクトに対して行われた変更の各々につ いて簡潔なパラグラフを表示する. Mercurialの用語では,履歴中の変更のイベ @@ -283,18 +266,27 @@ \hgcmd{log}から出力される記録の各フィールドは次のようになっている. \begin{itemize} %\item[\texttt{changeset}] This field has the format of a number, -% followed by a colon, followed by a hexadecimal string. These are -% \emph{identifiers} for the changeset. There are two identifiers -% because the number is shorter and easier to type than the hex -% string. -\item[\texttt{changeset}] 数字,それに続くコロンおよび16進文字列.これは - チェンジセットの\emph{識別子}である.数字は短く入力も容易で - あるため用意されている. +% followed by a colon, followed by a hexadecimal (or +% \emph{hex}) string. These are \emph{identifiers} for the +% changeset. The hex string is a unique identifier: the same +% hex string will always refer to the same changeset. The +% number is shorter and easier to type than the hex string, +% but it isn't unique: the same number in two different +% clones of a repository may identify different changesets. +% Why provide the number at all, then? For local +% convenience. +\item[\texttt{changeset}] 番号,それに続くコロンおよび16進文字列.これは + チェンジセットの\emph{識別子}である.16進文字列は固有の識別 + 子で,同一の識別子は常に同じチェンジセットを指す.番号は短く + 入力も16進文字列より容易であるが,チェンジセットに固有ではな + い.同じ番号でもリポジトリの別のクローンでは,違うチェンジセッ + トを指す可能性がある.番号は単にローカルな利便のために提供さ + れている. %\item[\texttt{user}] The identity of the person who created the % changeset. This is a free-form field, but it most often contains a % person's name and email address. \item[\texttt{user}] チェンジセット作成者.このフィールドの書式は自由だ - が,殆んどの場合氏名とemailアドレスである. + が,ほとんどの場合氏名とemailアドレスである. %\item[\texttt{date}] The date and time on which the changeset was % created, and the timezone in which it was created. (The date and % time are local to that timezone; they display what time and date it @@ -306,6 +298,15 @@ % creator of the changeset entered to describe the changeset. \item[\texttt{summary}] テキストメッセージの最初の行はチェンジセットの説 明に入力されたチェンジセットの作成者である. +% \item Some changesets, such as the first in the list above, have a +% \texttt{tag} field. A tag is another way to identify a +% changeset, by giving it an easy-to-remember name. (The tag +% named \texttt{tip} is special: it always refers to the +% newest change in a repository.) + \item 上のリストの最初のチェンジセットのように\texttt{tag}フィールドを持 + つチェンジセットもある.タグはチェンジセットを識別するためのもう + 一つの方法で,覚えやすい名前を自由に付けることができる.(タグ + \texttt{tip}は特別で,常にリポジトリの最新のチェンジセットを指す.) \end{itemize} %The default output printed by \hgcmd{log} is purely a summary; it is %missing a lot of detail. @@ -360,15 +361,16 @@ ンジセットを番号と16進文字列で表していたことを思い出して欲しい. %\begin{itemize} -%\item The revision number is \emph{only valid in that repository}, -%\item while the hex string is the \emph{permanent, unchanging +%\item The revision number is a handy notation that \emph{only valid in +% that repository}. +%\item The hexadecimal string is the \emph{permanent, unchanging % identifier} that will always identify that exact changeset in % \emph{every} copy of the repository. %\end{itemize} \begin{itemize} -\item リビジョン番号は\emph{そのリポジトリに限って有効であり}, -\item それに対して16進文字列は\emph{永続的かつ不変の識別子}で,リポジト - リのコピー\emph{全て}で常に特定のチェンジセットを示す. +\item リビジョン番号は\emph{そのリポジトリに限って有効}な簡便記法である. +\item 16進文字列は\emph{永続的かつ不変の識別子}で,リポジトリのコピー + \emph{全て}で常に特定のチェンジセットを示す. \end{itemize} %This distinction is important. If you send someone an email talking @@ -378,14 +380,14 @@ %arrived in a repository, and there is no guarantee that the same %changes will happen in the same order in different repositories. %Three changes $a,b,c$ can easily appear in one repository as $0,1,2$, -%while in another as $1,0,2$. +%while in another as $0,2,1$. この区別は重要である.誰かに``revision~33''と言った時,そのリビジョン33が 自分のリポジトリのリポジトリのものとは\emph{違うものである}可能性は高い. その理由は,リビジョン番号はリポジトリに変更が現れた順序によって決ま り,Mercurialでは別のリポジトリで同じ変更が同じ順序で起こる保証はないため である. 3つの変更$a,b,c$は,あるリポジトリで$0,1,2$の順で起こり,別のリ -ポジトリでは$1,0,2$の順序で起こり得る. +ポジトリでは$0,2,1$の順序で起こり得る. %Mercurial uses revision numbers purely as a convenient shorthand. If %you need to discuss a changeset with someone, or make a record of a @@ -401,13 +403,13 @@ %To narrow the output of \hgcmd{log} down to a single revision, use the %\hgopt{log}{-r} (or \hgopt{log}{--rev}) option. You can use either a -%revision number or a long-form changeset identifier, and you can +%revision number or a hexadecimal changeset identifier, and you can %provide as many revisions as you want. \interaction{tour.log-r} \hgcmd{log}の出力をある1つのリビジョンに制限するためには, \hgopt{log}{-r}(または \hgopt{log}{--rev})オプションを用いる.リビジョ -ン番号も長形式のチェンジセット識別子も利用可能であり,指定できるリビジョ -ンの数に制限はない. +ン番号も16進文字列のチェンジセット識別子も利用可能であり,指定できるリビ +ジョンの数に制限はない. \interaction{tour.log-r} %If you want to see the history of several revisions without having to @@ -456,6 +458,11 @@ ば概略を\ref{sec:mq:patch}節で見ることができる.) \interaction{tour.log-vp} +%The \hgopt{log}{-p} option is tremendously useful, so it's well worth +%remembering. + +\hgopt{log}{-p}オプションは驚異的に便利なので覚えておくと良い. + %\section{All about command options} \section{コマンドオプションのすべて} @@ -498,6 +505,12 @@ \item オプションの命名と使用法はコマンド間で一貫している.例を挙げると, チェンジセットIDまたはリビジョン番号を指定させるコマンドの全てで \hgopt{log}{-r}と\hgopt{log}{--rev}の両方を受け付ける. +% \item If you are using short options, you can save typing by running +% them together. For example, the command \hgopt{log}{-v -p -r 2} +% can be written as \hgopt{log}{-vpr2} + \item 短形式のオプションを使っている時はあ,複数のオプションを組み合わせ + て入力の手間を省くことができる.例えば\hgopt{log}{-v -p -r 2}は + \hgopt{log}{-vpr2}と書くことができる. \end{itemize} %In the examples throughout this book, I use short options instead of %long. This just reflects my own preference, so don't read anything @@ -512,6 +525,26 @@ オプションを付けるとより詳細な出力を行い,\hggopt{-q}(または \hggopt{--quiet})オプションを付けるとより簡潔な出力となる. +%\begin{note} +%Option naming consistency +% +%Almost always, Mercurial commands use consistent option names to refer +%to the same concepts. For instance, if a command deals with changesets, +%you'll always identify them with \hgopt{log}{--rev} or \hgopt{log}{-r} + +%This consistent use of option names makes it easier to remember what +%options a particular command takes. +%\end{note} + +\begin{note} +オプション名の一貫性 + +Mercurialコマンドでは,同じ対象を扱う際,ほとんど常に同じオプション名を使 +うようになっている.例を挙げると,チェンジセットを扱うコマンドの場合は常 +に\hgopt{log}{--rev}や\hgopt{log}{-r}でチェンジセットの指定ができる.この +一貫性により,組まんどのオプションが覚えやすくなっている. +\end{note} + %\section{Making and reviewing changes} \section{変更の仕方,変更のレビュー} @@ -527,6 +560,13 @@ %of it locally, we can just clone that instead. This is much faster %than cloning over the network, and cloning a local repository uses %less disk space in most cases, too. +%\begin{footnote} +%The saving of space arises when source and destination repositories are +%on the same filesystem, in which case Mercurial will use hardlinks to do +%copy-on-write sharing of its internal metadata. If that explanation +%meant nothing to you, don't worry: everything happens transparently and +%automatically, and you don't need to understand it. +%\end{footnote} %\interaction{tour.reclone} %As an aside, it's often good practice to keep a ``pristine'' copy of a %remote repository around, which you can then make temporary clones of @@ -541,6 +581,12 @@ よく,リモートのリポジトリをコピーする必要はない.ローカルなクローンはネッ トワーク越しに行うクローンよりもずっと速く,多くの場合使用するディスク容 量も少ない. +\begin{footnote} +同一ファイルシステム上でリポジトリのクローンを行う場合, Mercurialはハー +ドリンクを使い,内部メタデータをコピーオンライトで共有し,ディスク使用量 +の節約を行う.この説明がよくわからなくても心配する必要はない.この動作は +すべて透過的かつ自動的に行われるため,気にする必要はない. +\end{footnote} \interaction{tour.reclone} また,何か作業をしたい時にサンドボックスとするために一時的なクローンを作 成し,リモートリポジトリのコピーを``清潔''に保つことはしばしば役に立つ. @@ -551,20 +597,15 @@ %In our \dirname{my-hello} repository, we have a file %\filename{hello.c} that contains the classic ``hello, world'' program. -%Let's use the ancient and venerable \command{sed} command to edit this -%file so that it prints a second line of output. (I'm only using -%\command{sed} to do this because it's easy to write a scripted example -%this way. Since you're not under the same constraint, you probably -%won't want to use \command{sed}; simply use your preferred text editor to -%do the same thing.) -%\interaction{tour.sed} +%\interaction{tour.cat1} +\dirname{my-hello}リポジトリ内にはクラシックな``hello, world''プログラム +である\filename{hello.c}がある. +\interaction{tour.cat1} -\dirname{my-hello}リポジトリ内にはクラシックな``hello, world''プログラム -である\filename{hello.c}がある.古くさく森厳な\command{sed}を用いて2行目 -の出力を行うように変更する.(\command{sed}を使うのはスクリプトによる例を -作るのが簡単だからに過ぎない.読者まで\command{sed}を使う必要はなく,好き -なテキストエディタで編集してよい.) -\interaction{tour.sed} +%Let's edit this file so that it prints a second line of output. +%\interaction{tour.cat2} +このファイルを2行目が出力されるように編集する. +\interaction{tour.cat2} %Mercurial's \hgcmd{status} command will tell us what Mercurial knows %about the files in the repository. @@ -573,7 +614,6 @@ %starting with ``\texttt{M}'' for \filename{hello.c}. Unless you tell %it to, \hgcmd{status} will not print any output for files that have %not been modified. - リポジトリ内のファイルに対してMercurialが把握している内容を \hgcmd{status}コマンドで見ることができる. \interaction{tour.status} @@ -593,7 +633,7 @@ ら変更するファイルを登録する必要はないし,変更後に行う必要もない.変更さ れたファイルの発見は自動的に行われる. -%It's a little bit helpful to know that we've modified +%It's a somewhat helpful to know that we've modified %\filename{hello.c}, but we might prefer to know exactly \emph{what} %changes we've made to it. To do this, we use the \hgcmd{diff} %command. @@ -603,6 +643,19 @@ むしろ\emph{何を}変更したのかである.\hgcmd{diff}コマンドを使えばこれを知 ることができる. \interaction{tour.diff} +%\begin{note} +%Understanding patches +% +%Remember to take a look at section~\ref{sec:mq:patch} if you don't know +%how to read output above. +%\end{note} + +\begin{note} +パッチについて + +上の出力の読み方が分からない場合は,\ref{sec:mq:patch}節を参照されたい. +\end{note} + %\section{Recording changes in a new changeset} \section{新たなチェンジセットへ変更を記録する} @@ -690,6 +743,9 @@ %\sfilename{.hgrc} in your home directory. Mercurial will use this %file to look up your personalised configuration settings. The initial %contents of your \sfilename{.hgrc} should look like this. +%\begin{footnote} +%Figure out what the appropriate directory is on Windows. +%\end{footnote} %\begin{codesample2} % # This is a Mercurial configuration file. % [ui] @@ -706,6 +762,9 @@ \sfilename{.hgrc}というファイルを作成する. Mercurialはこのファイルから個 人設定を取得し,使用する.\sfilename{.hgrc}ファイルの最初の内容は以下のよ うな書式にする. +\begin{footnote} +Windowsでの適切なディレクトリを示すこと. +\end{footnote} \begin{codesample2} # This is a Mercurial configuration file. [ui] @@ -723,14 +782,14 @@ %You can use any text you like as the value of the \texttt{username} %config item, since this information is for reading by other people, -%but for interpreting by Mercurial. The convention that most people -%follow is to use their name and email address, as in the example +%but will not be interpreted by Mercurial. The convention that most +%people follow is to use their name and email address, as in the example %above. -\texttt{username}の設定に使用する文字列は,これがMercurialによって処理さ -れるという点を除けば,単に他のユーザが読むというだけの情報であることか -ら,どのような文字列でも構わない.多くのユーザが従う習慣は,上の例のよう -に名前とemailアドレスを使うものである. +\texttt{username}の設定に使用する文字列は,他のユーザが読む情報であるに過 +ぎず,Mercurialによって処理されるものではないため,どのような文字列でも構 +わない.多くのユーザが従う習慣は,上の例のように名前とemailアドレスを使う +ものである. \begin{note} % Mercurial's built-in web server obfuscates email addresses, to make @@ -760,11 +819,16 @@ \interaction{tour.commit} %The editor that the \hgcmd{commit} command drops us into will contain -%an empty line, followed by a number of lines starting with +%an empty line or two, followed by a number of lines starting with %``\texttt{HG:}''. -%\begin{codesample2} -% \emph{empty line} -% HG: changed hello.c +%%\begin{codesample2} +%This is where I type my commit comment. +% +%HG: Enter commit message. Lines beginning with 'HG:' are removed. +%HG: -- +%HG: user: Bryan O'Sullivan +%HG: branch 'default' +%HG: changed hello.c %\end{codesample2} %Mercurial ignores the lines that start with ``\texttt{HG:}''; it uses %them only to tell us which files it's recording changes to. Modifying @@ -773,8 +837,13 @@ \hgcmd{commit}コマンドが起動するエディタは,空行と``\texttt{HG:}''で始ま る数行をすでに含んでいる. \begin{codesample2} - \emph{empty line} - HG: changed hello.c +This is where I type my commit comment. + +HG: Enter commit message. Lines beginning with 'HG:' are removed. +HG: -- +HG: user: Bryan O'Sullivan +HG: branch 'default' +HG: changed hello.c \end{codesample2} Mercurialは``\texttt{HG:}''で始まる行を無視する.これらの行はどのファイル への変更なのかをユーザに伝えるだけの目的で存在する.これらの行を変更した @@ -848,14 +917,26 @@ %that is identical to \hgcmd{log}, but it only displays the newest %revision in the repository. %\interaction{tour.tip} -%We refer to the newest revision in the repository as the tip revision, -%or simply the tip. +%We refer to the newest revision in the repository as the \emph{tip revision}, +%or simply the \emph{tip}. コミットの完了後,\hgcmd{tip}コマンドで今作成したチェンジセットを知ること ができる.このコマンドの出力はリポジトリの最新リビジョンのみを表示すると いう点を除けば\hgcmd{log}と全く同じである. \interaction{tour.tip} -リポジトリの最新リビジョンはtipリビジョンまたは単にtipと呼ばれる. +リポジトリの最新リビジョンは\emph{tipリビジョン}または単に\emph{tip}と呼 +ばれる. + +%By the way, the \hgcmpd{tip} command accepts many of the same options as +%\hgcmd{log}, so \hgopt{log}{-v} above indicates ``be verbose'', +%\hgopt{log}{-p} specifies ``print a patch''. The use of \hgopt{log}{-p} +%to print patches is another example of the consistent naming we +%mentioned earlier. + +\hgcmpd{tip}コマンドでは\hgcmd{log}コマンドのオプションの多くが使える.上 +記の\hgopt{log}{-v}は``冗長''な表示を行うし,\hgopt{log}{-p}は``パッチの +表示''を行う.\hgopt{log}{-p}でパッチが表示されるのは,前述のオプション名 +の一貫性を示すもう一つの例である. %\section{Sharing changes} \section{変更を共有する} @@ -890,10 +971,6 @@ %what changes the \hgcmd{pull} command \emph{would} pull into the %repository, without actually pulling the changes in. %\interaction{tour.incoming} -%(Of course, someone could cause more changesets to appear in the -%repository that we ran \hgcmd{incoming} in, before we get a chance to -%\hgcmd{pull} the changes, so that we could end up pulling changes that we -%didn't expect.) \hgcmd{pull}コマンドで変更を\dirname{my-hello}から\dirname{hello-pull}に 取り込む.未知の変更を盲目的にリポジトリにpullすることは少々恐ろし @@ -901,9 +978,17 @@ まれるのかを実際にはpullすることなく表示する\hgcmd{incoming}コマンドがあ る. \interaction{tour.incoming} -(もちろん\hgcmd{incoming}を実行してから実際に\hgcmd{pull}するまでの間に -誰かが新たなチェンジセットを追加し,その結果,予期しないチェンジセットを -pullしてしまう可能性はある.) + +%Suppose you're pulling changes from a repository on the network +%somewhere. While you are looking at the \hgcmd{incoming} output, and +%before you pull those changes, someone might have committed something in +%the remote repository. This means that it's possible to pull more +%changes than you saw when using \hgcmd{incoming}. + +おそらく読者はネットワーク上のどこかからリポジトリをpullするに違いない. +変更をpullする前,\hgcmd{incoming}の出力を見ている間に誰かがリモートリポ +ジトリに何かコミットすることも有り得る.この場合,\hgcmd{incoming}で見た +ものよりも多くの変更がpullされることになる. %Bringing changes into a repository is a simple matter of running the %\hgcmd{pull} command, and telling it which repository to pull from. @@ -1028,10 +1113,6 @@ %\interaction{tour.outgoing} %And the \hgcmd{push} command does the actual push. %\interaction{tour.push} -%As with \hgcmd{pull}, the \hgcmd{push} command does not update the -%working directory in the repository that it's pushing changes into. -%(Unlike \hgcmd{pull}, \hgcmd{push} does not provide a \texttt{-u} -%option that updates the other repository's working directory.) Mercurialでは現在使用しているリポジトリから他のリポジトリに変更をpushする ことができる.前述の\hgcmd{pull}コマンドのように,一時的なリポジトリを作っ @@ -1042,10 +1123,23 @@ \interaction{tour.outgoing} \hgcmd{push}コマンドで実際にpushを行う. \interaction{tour.push} + +%As with \hgcmd{pull}, the \hgcmd{push} command does not update the +%working directory in the repository that it's pushing changes into. +%Unlike \hgcmd{pull}, \hgcmd{push} does not provide a \texttt{-u} option +%that updates the other repository's working directory. This asymmetry +%is deliberate: the repository we're pushing to might be on a remote +%server and shared between several people. If we were to update its +%working directory while someone was working in it, their work would be +%disrupted. + \hgcmd{pull}コマンドと同様に,\hgcmd{push}コマンドはpush先のリポジトリの -ワーキングディレクトリの更新を行わない.(\hgcmd{pull}コマンドと違って +ワーキングディレクトリの更新を行わない.\hgcmd{pull}コマンドと違って \hgcmd{push}コマンドは,ワーキングディレクトリの更新を行う\texttt{-u}オプ -ションを持たない.) +ションを持たない.この非対称性は意図的なもので,push先のリポジトリはリモー +トサーバ上にあるかもしれず,複数のユーザから共有されている可能性がある. +もし誰かが作業中のワーキングディレクトリを更新したら,その作業内容は台無 +しになってしまう. %What happens if we try to pull or push changes and the receiving %repository already has those changes? Nothing too exciting.