hgbook

diff en/cmdref.tex @ 241:09d5897ad935

Fix a few more errors in the index.
author Bryan O'Sullivan <bos@serpentine.com>
date Sun May 27 09:57:17 2007 -0700 (2007-05-27)
parents e1e2f3e0256a
children 92660e72d6bf
line diff
     1.1 --- a/en/cmdref.tex	Thu Dec 28 16:45:56 2006 -0800
     1.2 +++ b/en/cmdref.tex	Sun May 27 09:57:17 2007 -0700
     1.3 @@ -1,17 +1,41 @@
     1.4  \chapter{Command reference}
     1.5  \label{cmdref}
     1.6  
     1.7 -\cmdref{diff}
     1.8 +\cmdref{add}{add files at the next commit}
     1.9 +\optref{add}{I}{include}
    1.10 +\optref{add}{X}{exclude}
    1.11 +\optref{add}{n}{dry-run}
    1.12 +
    1.13 +\cmdref{diff}{print changes in history or working directory}
    1.14  
    1.15  Show differences between revisions for the specified files or
    1.16  directories, using the unified diff format.  For a description of the
    1.17  unified diff format, see section~\ref{sec:mq:patch}.
    1.18  
    1.19 -\optref{diff}{-r}{--rev}
    1.20 +By default, this command does not print diffs for files that Mercurial
    1.21 +considers to contain binary data.  To control this behaviour, see the
    1.22 +\hgopt{diff}{-a} and \hgopt{diff}{--git} options.
    1.23  
    1.24 -Specify a revision to compare.
    1.25 +\subsection{Options}
    1.26  
    1.27 -\optref{diff}{-a}{--text}
    1.28 +\loptref{diff}{nodates}
    1.29 +
    1.30 +Omit date and time information when printing diff headers.
    1.31 +
    1.32 +\optref{diff}{B}{ignore-blank-lines}
    1.33 +
    1.34 +Do not print changes that only insert or delete blank lines.  A line
    1.35 +that contains only whitespace is not considered blank.
    1.36 +
    1.37 +\optref{diff}{I}{include}
    1.38 +
    1.39 +Exclude files and directories whose names match the given patterns.
    1.40 +
    1.41 +\optref{diff}{X}{exclude}
    1.42 +
    1.43 +Include files and directories whose names match the given patterns.
    1.44 +
    1.45 +\optref{diff}{a}{text}
    1.46  
    1.47  If this option is not specified, \hgcmd{diff} will refuse to print
    1.48  diffs for files that it detects as binary. Specifying \hgopt{diff}{-a}
    1.49 @@ -19,18 +43,37 @@
    1.50  all of them.
    1.51  
    1.52  This option is useful for files that are ``mostly text'' but have a
    1.53 -few embedded NUL characters.  If you use it on files that are really
    1.54 -binary, its output will be incomprehensible.
    1.55 +few embedded NUL characters.  If you use it on files that contain a
    1.56 +lot of binary data, its output will be incomprehensible.
    1.57  
    1.58 -\subsection{Specifying revisions}
    1.59 +\optref{diff}{b}{ignore-space-change}
    1.60  
    1.61 -The \hgcmd{diff} command accepts up to two \hgopt{diff}{-r} options to
    1.62 -specify the revisions to compare.
    1.63 +Do not print a line if the only change to that line is in the amount
    1.64 +of white space it contains.
    1.65 +
    1.66 +\optref{diff}{g}{git}
    1.67 +
    1.68 +Print \command{git}-compatible diffs.  XXX reference a format
    1.69 +description.
    1.70 +
    1.71 +\optref{diff}{p}{show-function}
    1.72 +
    1.73 +Display the name of the enclosing function in a hunk header, using a
    1.74 +simple heuristic.  This functionality is enabled by default, so the
    1.75 +\hgopt{diff}{-p} option has no effect unless you change the value of
    1.76 +the \rcitem{diff}{showfunc} config item, as in the following example.
    1.77 +\interaction{cmdref.diff-p}
    1.78 +
    1.79 +\optref{diff}{r}{rev}
    1.80 +
    1.81 +Specify one or more revisions to compare.  The \hgcmd{diff} command
    1.82 +accepts up to two \hgopt{diff}{-r} options to specify the revisions to
    1.83 +compare.
    1.84  
    1.85  \begin{enumerate}
    1.86  \setcounter{enumi}{0}
    1.87 -\item Display the differences between the parent of the working
    1.88 -  directory and the working directory.
    1.89 +\item Display the differences between the parent revision of the
    1.90 +  working directory and the working directory.
    1.91  \item Display the differences between the specified changeset and the
    1.92    working directory.
    1.93  \item Display the differences between the two specified changesets.
    1.94 @@ -53,7 +96,34 @@
    1.95  contents.  You cannot reverse the ordering in this way if you are
    1.96  diffing against the working directory.
    1.97  
    1.98 -\subsection{Why do the results of \hgcmd{diff} and \hgcmd{status}
    1.99 +\optref{diff}{w}{ignore-all-space}
   1.100 +
   1.101 +\cmdref{version}{print version and copyright information}
   1.102 +
   1.103 +This command displays the version of Mercurial you are running, and
   1.104 +its copyright license.  There are four kinds of version string that
   1.105 +you may see.
   1.106 +\begin{itemize}
   1.107 +\item The string ``\texttt{unknown}''. This version of Mercurial was
   1.108 +  not built in a Mercurial repository, and cannot determine its own
   1.109 +  version.
   1.110 +\item A short numeric string, such as ``\texttt{1.1}''. This is a
   1.111 +  build of a revision of Mercurial that was identified by a specific
   1.112 +  tag in the repository where it was built.  (This doesn't necessarily
   1.113 +  mean that you're running an official release; someone else could
   1.114 +  have added that tag to any revision in the repository where they
   1.115 +  built Mercurial.)
   1.116 +\item A hexadecimal string, such as ``\texttt{875489e31abe}''.  This
   1.117 +  is a build of the given revision of Mercurial.
   1.118 +\item A hexadecimal string followed by a date, such as
   1.119 +  ``\texttt{875489e31abe+20070205}''.  This is a build of the given
   1.120 +  revision of Mercurial, where the build repository contained some
   1.121 +  local changes that had not been committed.
   1.122 +\end{itemize}
   1.123 +
   1.124 +\subsection{Tips and tricks}
   1.125 +
   1.126 +\subsubsection{Why do the results of \hgcmd{diff} and \hgcmd{status}
   1.127    differ?}
   1.128  \label{cmdref:diff-vs-status}
   1.129  
   1.130 @@ -87,7 +157,7 @@
   1.131  \hgopt{diff}{-r} option.  There is no way to print diffs relative to
   1.132  both parents.
   1.133  
   1.134 -\subsection{Generating safe binary diffs}
   1.135 +\subsubsection{Generating safe binary diffs}
   1.136  
   1.137  If you use the \hgopt{diff}{-a} option to force Mercurial to print
   1.138  diffs of files that are either ``mostly text'' or contain lots of