<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">
<sect1 id="tsvn-dug-repoviewer">
	<title>Integration with Web-based Repository Viewers</title>
	<indexterm>
		<primary>web view</primary>
	</indexterm>
	<indexterm>
		<primary>repo viewer</primary>
	</indexterm>
	<indexterm>
		<primary>ViewVC</primary>
	</indexterm>
	<indexterm>
		<primary>WebSVN</primary>
	</indexterm>
	<para>
		There are several web-based repository viewers available for use with
		Git such as
		<ulink url="http://www.viewvc.org/">
			<citetitle>ViewVC</citetitle>
		</ulink>
		and 
		<ulink url="http://websvn.tigris.org/">
			<citetitle>WebSVN</citetitle>
		</ulink>.
		TortoiseGit provides a means to link with these viewers.
	</para>
	<para>
		You can integrate a repo viewer of your choice in TortoiseGit.
		To do this, you have to define some properties which define the linkage.
		They must be set on Folders: (<xref linkend="tsvn-dug-propertypage"/>)
	</para>
	<para>
		<variablelist>
			<varlistentry>
				<term condition="pot">webviewer:revision</term>
				<listitem>
					<para>
						Set this property to the URL of your repo viewer to view all
						changes in a specific revision.
						It must be properly URI encoded and it has to contain
						<literal>%REVISION%</literal>.
						<literal>%REVISION%</literal> is replaced with the revision
						number in question.
						This allows TortoiseGit to display a context menu entry in the
						log dialog
						<menuchoice>
							<guimenu>Context Menu</guimenu>
							<guimenuitem>View revision in webviewer</guimenuitem>
						</menuchoice>
					</para>
				</listitem>
			</varlistentry>
			<varlistentry>
				<term condition="pot">webviewer:pathrevision</term>
				<listitem>
					<para>
						Set this property to the URL of your repo viewer to view
						changes to a specific file in a specific revision.
						It must be properly URI encoded and it has to contain
						<literal>%REVISION%</literal> and <literal>%PATH%</literal>.
						<literal>%PATH%</literal> is replaced with the path relative
						to the repository root.
						This allows TortoiseGit to display a context menu entry in the
						log dialog
						<menuchoice>
							<guimenu>Context Menu</guimenu>
							<guimenuitem>View revision and path in webviewer</guimenuitem>
						</menuchoice>
						For example, if you right-click in the log dialog bottom pane
						on a file entry <literal>/trunk/src/file</literal> then the
						<literal>%PATH%</literal> in the URL will be replaced with
						<literal>/trunk/src/file</literal>.
					</para>
				</listitem>
			</varlistentry>
		</variablelist>
	</para>
	<para>
		You can also use relative URLs instead of absolute ones. This is useful
		in case your web viewer is on the same domain/server as your source
		repository. In case the domain name ever changes, you don't have to adjust
		the <literal>webviewer:revision</literal> and <literal>webviewer:pathrevision</literal> 
		property. The format is the same as for the <literal>bugtraq:url</literal> property.
		See <xref linkend="tsvn-dug-bugtracker"/>.
	</para>
	<important>
		<title>Set the Properties on Folders</title>
		<para>
			These properties must be set on folders for the system to work. 
			When you commit a file or folder the properties are read from that folder.
			If the properties are not found there, TortoiseGit will search upwards
			through the folder tree to find them until it comes to an unversioned
			folder, or the tree root (eg. <literal>C:\</literal>) is found.
			If you can be sure that each user checks out only from e.g
			<filename>trunk/</filename> and not some sub-folder, then it's enough if
			you set the properties on <filename>trunk/</filename>.
			If you can't be sure, you should set the properties recursively
			on each sub-folder.
			A property setting deeper in the project hierarchy overrides settings on
			higher levels (closer to <filename>trunk/</filename>).
		</para>
		<para>
			For <literal>tsvn:</literal> properties <emphasis>only</emphasis>
			you can use the <guilabel>Recursive</guilabel> checkbox to set
			the property to all sub-folders in the hierarchy, without also
			setting it on all files.
		</para>
	</important>
	<tip>
		<title>No Repo Viewer Links from Repository Browser</title>
		<para>
			Because the repo viewer integration depends upon accessing Git
			properties, you will only see the results when using a checked
			out working copy. Fetching properties remotely is a slow operation,
			so you will not see this feature in action from the repo browser.
		</para>
	</tip>
</sect1>
