blob: 3699640672304da2d350657595fa2bb6c6370f5a [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en">
<HEAD>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2013. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<LINK REL="STYLESHEET" HREF="team-cvs.css" CHARSET="ISO-8859-1" TYPE="text/css">
<title>Local history</title>
</HEAD>
<BODY>
<h1>Local history</h1>
<p> Every time an editable file is saved in the Workbench, the Workbench
updates the local history of that file and logs the changes that have been made.
The local history of a file can then be accessed and a previously saved copy
of the file can be reverted to, as long as the desired state is recent enough
in the save history.</p>
<ol>
<li class="Steps">Create a new file named <em class="FileName">sampleFile.txt</em>.
</li>
<li class="Steps">In the editor for <em class="FileName">sampleFile.txt</em> modify the file by adding the line
&quot;change1&quot; and saving the file.
</li>
<li class="Steps">Repeat this by entering a new line &quot;change2&quot; and saving it again.
</li>
<li class="Steps">Add a third line &quot;change3&quot; and save it again. </li>
<li class="Steps">Right-click the file in a navigation view (e.g. the Project Explorer) and
select <em class="UILabel">Team &gt; Show Local History</em>.
<p><em>Note:</em> Repository tooling may override the <em class="UILabel">Team &gt; Show Local History</em>
operation to provide a unified history for a file. The Eclipse CVS client does override this action.
To get the history for
a file in a project that is shared with CVS, you will need to right-click the file and select
<em class="UILabel">Team &gt; Show History</em>. See
<a href="qs-70_workingWithHistory.htm">Working with CVS History</a> for more details about the
CVS history of a file.</p>
</li>
<li class="Steps">The History view opens and shows the history for the file.
<img class="Big" src="../images/localHistoryView.png" alt="Local History view" border="0">
</li>
<li class="Steps">The top entry in the view represents the current contents of the file.
The next represents the previous contents and so on.
Right-click on the previous entry and select <em class="UILabel">Compare Current with Local</em>
to open a Compare editor that displays the differences between
the Workbench file and the specific copy of the file selected in the local
history.
<img class="Big" src="../images/localHistoryCompare.png" alt="Local History Compare Editor" border="0">
</li>
<li class="Steps">Right-click on the previous entry again and select <em class="UILabel">Get Contents</em>.
This replaces the Workbench's copy of
<em class="FileName">sampleFile.txt</em> with the chosen local history item.
</li>
<li class="Steps">Observe that the <em class="FileName">sampleFile.txt</em> editor now contains two lines.
</li>
</ol>
</BODY>
</HTML>