<title>Revision Control Support</title>

<h1>Introduction</h1>

Eskil can compare versions in meny revision control systems.
Currently RCS, CVS, Git, Fossil, Mercurial, Bazaar, Subversion, Perforce and ClearCase are supported (some features are not implemented for all systems).

If you specify only one file on the command line to Eskil, it will
automatically detect if the file is under revision control and enter revision
control mode.

By default the local file is compared against the latest checked in version.
This is for the common case when you just want to know what you have changed
before checking in.

You can use the -r option to select which versions to compare.
The valid values for the -r option depends on the tools used. See below for
details on each one.

Examples:

Compare file.txt with the latest checked in version:

<pre>eskil file.txt</pre>

Compare file.txt with the specified version:

<pre>eskil -r rev file.txt</pre>

Compare the two revisions. This does not involve the local copy of file.txt.

<pre>eskil -r rev1 -r rev2 file.txt</pre>

The -r options are also available in the GUI in the "Rev 1" and "Rev 2" fields.

<h1>Directory Diff</h1>

Eskil can also browse and compare revisions for some systems directly in the
directory diff. It works just like for files, but give a directory on the
command line. Currently Git, Fossil and Subversion are supported.

<h1>Commit support</h1>

When comparing a file with the latest checked in version, some of the systems
have support for committing directly from Eskil.
If supported, the Commit button will be enabled.
It is also possible to revert the local changes using the Revert button.

<h1>Priority between systems</h1>

If multiple systems are used within a directory Git/Hg/Bzr will be detected before CVS/SVN.  Command line options -cvs and -svn can be used to put preference on one of those systems.

<h1>Pipe a patch</h1>

Eskil can read a patch from standard input, thus allowing display from any
patch generating command. Examples:

<pre>hg diff | eskil -</pre>
<pre>git diff -p --diff-filter=M master | eskil -</pre>

<h1>View all changes</h1>

If the command line option -review is used, Eskil will generate a patch
for the current tree and display it as in patch mode.

<verbatim>eskil -preview [files] </verbatim>

E.g. in a Mercurial directory, these show the same thing:

<pre>eskil -preview</pre>
<pre>hg diff | eskil -</pre>

If file names are given after -review, only the listed files are included.
If supported, the Commit button will be enabled allowing the viewed differences
to be committed directly from Eskil.

<h1>Conflict merging</h1>

Eskil can be used as a conflict resolution tool. See examples below for settings.

<h1>Tools Details</h1>

<h2>RCS/CVS</h2>

For RCS and CVS the arguments to -r are standard version numbers just like to their -r options.  RCS style -r&lt;crev&gt; is allowed.
If a revision is an integer, it is added to the last number in the current version, thus giving relative versions.  E.g. -1 gives the second to last version.

<h2>Subversion</h2>

For Subversion the arguments to -r are standard version numbers just like its -r option.
If a revision is a negative integer, the log is searched backwards for earlier versions.
E.g. -1 gives the second to last version.

<h2>Git</h2>

For Git -r <rev> is passed to show, as in "git show <rev>:<file>".

To use Eskil for conflict resolution these settings can be used.

<pre>git config --global merge.tool eskil</pre>
<pre>git config --global mergetool.eskil.cmd 'eskil -fine -a $BASE -o $MERGED $REMOTE $LOCAL'</pre>
<pre>git config --global diff.tool eskil</pre>
<pre>git config --global difftool.eskil.cmd 'eskil $LOCAL $REMOTE'</pre>

<h2>Fossil</h2>

For Fossil -r <rev> is passed to finfo, as in "fossil finfo -p <file> -r <rev>".

Additionaly, if a revision is zero or a negative integer, the log is searched backwards
for earlier versions. E.g. -1 gives the second to last version. The search
follows the current branch from the current version.

To use Eskil for conflict resolution these settings can be used.

<pre>fossil settings gmerge-command 'eskil -fine -a "%baseline" "%merge" "%original" -o "%output"' -global</pre>

<h2>Mercurial</h2>

For Mercurial -r works as in "hg cat -r".

<h2>Bazaar</h2>

For Bazaar -r works as in "bzr cat -r".

<h2>ClearCase</h2>

ClearCase has more complex version "numbers".
ClearCase stream names are built like file paths and in -r you can access the streams
similar to how you find files.
Your current stream is the "current directory".
A negative version number is offset from latest.

  <tt>-r 5                    </tt>: Version 5 in current stream.<br>
  <tt>-r .                    </tt>: Latest version in current stream.<br>
  <tt>-r -1                   </tt>: Second to last version in current stream.<br>
  <tt>-r /full/path/stream/4  </tt>: The identified version.<br>
  <tt>-r /full/path/stream    </tt>: Latest version in that stream.<br>
  <tt>-r ../5                 </tt>: Version in parent stream.<br>
  <tt>-r ..                   </tt>: Latest in parent stream.<br>
  <tt>-r stream/5             </tt>: Version in stream, anywhere in tree.<br>
  <tt>-r stream               </tt>: Latest in stream, anywhere in tree.
