hgbook

diff en/hgext.tex @ 231:28ddbf9f3729

Use new \hgxcmd and \hgxopt commands in a few places.
author Bryan O'Sullivan <bos@serpentine.com>
date Sun May 27 09:39:58 2007 -0700 (2007-05-27)
parents eef2171243e8
children 2469608b4a08
line diff
     1.1 --- a/en/hgext.tex	Sat May 26 11:52:18 2007 -0700
     1.2 +++ b/en/hgext.tex	Sun May 27 09:39:58 2007 -0700
     1.3 @@ -13,7 +13,7 @@
     1.4  \begin{itemize}
     1.5  \item Section~\ref{sec:tour-merge:fetch} covers the \hgext{fetch}
     1.6    extension; this combines pulling new changes and merging them with
     1.7 -  local changes into a single command, \hgcmd{fetch}.
     1.8 +  local changes into a single command, \hgxcmd{fetch}{fetch}.
     1.9  \item The \hgext{bisect} extension adds an efficient pruning search
    1.10    for changes that introduced bugs, and we documented it in
    1.11    chapter~\ref{sec:undo:bisect}.
    1.12 @@ -148,13 +148,13 @@
    1.13    \hgext{mq}, enabled.  If you've never used MQ, read
    1.14    section~\ref{sec:mq:start} to get started quickly.
    1.15  \item Go into the \dirname{inotify} repo, and apply all of the
    1.16 -  \hgext{inotify} patches using the \hgopt{qpush}{-a} option to the
    1.17 -  \hgcmd{qpush} command.
    1.18 +  \hgext{inotify} patches using the \hgxopt{mq}{qpush}{-a} option to
    1.19 +  the \hgxcmd{mq}{qpush} command.
    1.20    \begin{codesample4}
    1.21      cd inotify
    1.22      hg qpush -a
    1.23    \end{codesample4}
    1.24 -  If you get an error message from \hgcmd{qpush}, you should not
    1.25 +  If you get an error message from \hgxcmd{mq}{qpush}, you should not
    1.26    continue.  Instead, ask for help.
    1.27  \item Build and install the patched version of Mercurial.
    1.28    \begin{codesample4}
    1.29 @@ -193,9 +193,9 @@
    1.30  status operations almost instantaneous on repositories of all sizes!
    1.31  
    1.32  If you like, you can manually start a status daemon using the
    1.33 -\hgcmd{inserve} command.  This gives you slightly finer control over
    1.34 -how the daemon ought to run.  This command will of course only be
    1.35 -available when the \hgext{inotify} extension is enabled.
    1.36 +\hgxcmd{inotify}{inserve} command.  This gives you slightly finer
    1.37 +control over how the daemon ought to run.  This command will of course
    1.38 +only be available when the \hgext{inotify} extension is enabled.
    1.39  
    1.40  When you're using the \hgext{inotify} extension, you should notice
    1.41  \emph{no difference at all} in Mercurial's behaviour, with the sole
    1.42 @@ -221,22 +221,23 @@
    1.43    [extensions]
    1.44    extdiff =
    1.45  \end{codesample2}
    1.46 -This introduces a command named \hgcmd{extdiff}, which by default uses
    1.47 -your system's \command{diff} command to generate a unified diff in the
    1.48 -same form as the built-in \hgcmd{diff} command.  
    1.49 +This introduces a command named \hgxcmd{extdiff}{extdiff}, which by
    1.50 +default uses your system's \command{diff} command to generate a
    1.51 +unified diff in the same form as the built-in \hgcmd{diff} command.
    1.52  \interaction{extdiff.extdiff}
    1.53  The result won't be exactly the same as with the built-in \hgcmd{diff}
    1.54  variations, because the output of \command{diff} varies from one
    1.55  system to another, even when passed the same options.
    1.56  
    1.57  As the ``\texttt{making snapshot}'' lines of output above imply, the
    1.58 -\hgcmd{extdiff} command works by creating two snapshots of your source
    1.59 -tree.  The first snapshot is of the source revision; the second, of
    1.60 -the target revision or working directory.  The \hgcmd{extdiff} command
    1.61 -generates these snapshots in a temporary directory, passes the name of
    1.62 -each directory to an external diff viewer, then deletes the temporary
    1.63 -directory.  For efficiency, it only snapshots the directories and
    1.64 -files that have changed between the two revisions.  
    1.65 +\hgxcmd{extdiff}{extdiff} command works by creating two snapshots of
    1.66 +your source tree.  The first snapshot is of the source revision; the
    1.67 +second, of the target revision or working directory.  The
    1.68 +\hgxcmd{extdiff}{extdiff} command generates these snapshots in a
    1.69 +temporary directory, passes the name of each directory to an external
    1.70 +diff viewer, then deletes the temporary directory.  For efficiency, it
    1.71 +only snapshots the directories and files that have changed between the
    1.72 +two revisions.
    1.73  
    1.74  Snapshot directory names have the same base name as your repository.
    1.75  If your repository path is \dirname{/quux/bar/foo}, then \dirname{foo}
    1.76 @@ -246,19 +247,20 @@
    1.77  \dirname{foo.a631aca1083f}.  A snapshot of the working directory won't
    1.78  have a changeset ID appended, so it would just be \dirname{foo} in
    1.79  this example.  To see what this looks like in practice, look again at
    1.80 -the \hgcmd{extdiff} example above.  Notice that the diff has the
    1.81 -snapshot directory names embedded in its header.
    1.82 -
    1.83 -The \hgcmd{extdiff} command accepts two important options.  The
    1.84 -\hgopt{extdiff}{-p} option lets you choose a program to view
    1.85 -differences with, instead of \command{diff}.  With the
    1.86 -\hgopt{extdiff}{-o} option, you can change the options that
    1.87 -\hgcmd{extdiff} passes to the program (by default, these options are
    1.88 -``\texttt{-Npru}'', which only make sense if you're running
    1.89 -\command{diff}).  In other respects, the \hgcmd{extdiff} acts
    1.90 -similarly to the built-in \hgcmd{diff} command: you use the same
    1.91 -option names, syntax, and arguments to specify the revisions you want,
    1.92 -the files you want, and so on.
    1.93 +the \hgxcmd{extdiff}{extdiff} example above.  Notice that the diff has
    1.94 +the snapshot directory names embedded in its header.
    1.95 +
    1.96 +The \hgxcmd{extdiff}{extdiff} command accepts two important options.
    1.97 +The \hgxopt{extdiff}{extdiff}{-p} option lets you choose a program to
    1.98 +view differences with, instead of \command{diff}.  With the
    1.99 +\hgxopt{extdiff}{extdiff}{-o} option, you can change the options that
   1.100 +\hgxcmd{extdiff}{extdiff} passes to the program (by default, these
   1.101 +options are ``\texttt{-Npru}'', which only make sense if you're
   1.102 +running \command{diff}).  In other respects, the
   1.103 +\hgxcmd{extdiff}{extdiff} command acts similarly to the built-in
   1.104 +\hgcmd{diff} command: you use the same option names, syntax, and
   1.105 +arguments to specify the revisions you want, the files you want, and
   1.106 +so on.
   1.107  
   1.108  As an example, here's how to run the normal system \command{diff}
   1.109  command, getting it to generate context diffs (using the
   1.110 @@ -282,9 +284,9 @@
   1.111  \subsection{Defining command aliases}
   1.112  
   1.113  It can be cumbersome to remember the options to both the
   1.114 -\hgcmd{extdiff} command and the diff viewer you want to use, so the
   1.115 -\hgext{extdiff} extension lets you define \emph{new} commands that
   1.116 -will invoke your diff viewer with exactly the right options.
   1.117 +\hgxcmd{extdiff}{extdiff} command and the diff viewer you want to use,
   1.118 +so the \hgext{extdiff} extension lets you define \emph{new} commands
   1.119 +that will invoke your diff viewer with exactly the right options.
   1.120  
   1.121  All you need to do is edit your \hgrc, and add a section named
   1.122  \rcsection{extdiff}.  Inside this section, you can define multiple
   1.123 @@ -316,6 +318,7 @@
   1.124    opts.vimdiff = -f '+next' '+execute "DirDiff" argv(0) argv(1)'
   1.125  \end{codesample2}
   1.126  
   1.127 +
   1.128  %%% Local Variables: 
   1.129  %%% mode: latex
   1.130  %%% TeX-master: "00book"