blob: 00fa682108ef71080956d8701fc3cf9932c8d76d [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML>
<HEAD>
<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">
<title>Updating</title>
<meta name="keyword" content="team">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1 CLASS="Head">Updating</H1>
<P>While you are working on a project in the Workbench, other members of your
team may be committing changes to the copy of the project in the repository.
To get these changes, you may &quot;update&quot; your Workbench to match the
state of the branch. The changes you will see will be specific to the branch
that your Workbench project is configured to share. You control when you choose
to update.
</P>
<p>The update command can be issued from two places: the <b>Team &gt; Update</b>
menu, or the <b>Synchronize</b> view. In order to understand the difference
between these two commands, it is important to know about the three different
kinds of incoming changes.
</p>
<ul>
<li>A <i>non-conflicting</i> change occurs when a file has been changed remotely
but has not been modified locally.</li>
<li>An <i>automergable conflicting</i> change occurs when an ASCII file has
been changed both remotely and locally (i.e. has non-committed local changes)
but the changes are on different lines.</li>
<li>A <i>non-automergable conflicting</i> change occurs when one or more of
the same lines of an ASCII file or when a binary file has been changed both
remotely and locally (binary files are never automergable).</li>
</ul>
<p>When you select <b>Team &gt; Update</b>, the contents of the local resources
will be updated with incoming changes of all of the above three types. For non-conflicting
and automergable conflicts, there is no additional action required (for automergable
conflicts, the changed local resource is moved to a file prefixed with &quot;.#&quot;
just in case the automerge wasn't what the user wanted). However, for non-automergable
conflicts, the conflicts are either merged into the local resource using special
CVS specific markup text (for ASCII files) or the changed local resource is
moved to a file prefixed with &quot;.#&quot; (for binary files). This matches
the CVS command line behavior but can be problematic when combined with the Eclipse
auto-build mechanism. Also, it is often desirable to know what incoming changes
there are before updating any local resources. These issues are addressed by
the Synchronize view.
</p>
<p>To open the Synchronize view in incoming mode:
</p>
<ol>
<li>In the Navigator view, select the resources which you want to update.</li>
<li>From the pop-up menu for the selected resources, select <b>Team &gt; Synchronize
with Repository</b>. The Synchronize view will open.</li>
<li>On the toolbar of the Synchronize View, click the <b> incoming mode</b>
button to filter out any modified Workbench resources (outgoing changes) that
you may have.</li>
</ol>
<p>In incoming mode, you will see changes that have been committed to the branch
since you last updated. The view will indicate the type of each incoming change
(non-conflict, automergable conflict or non-automergable conflict). There are
two update commands (available from the context menu of any resource in the
view) to deal with the different types of conflicts: <b>Update from Repository</b>
and <b>Override and Update</b>. When you select the <b>Update from Repository</b>
command in the Synchronize view, only non-conflicting changes are processed,
leaving any files that have automergable or non-automergable conflicts in the
view (any files that have been successfully processed are removed from the view).
The <b>Override and Update</b> command operates on the two types of conflicts.
After selecting this command, you will be prompted before a merge is attempted
and asked if you want to auto merge the contents or overwrite them with the
repository file. If you select to auto merge then only automergable conflicts
will be processed and the incoming changes will be automerged with the local
changes. Otherwise all conflicts will be processed and the local resources will
be replaced with the remote contents. This &quot;replace&quot; behavior is rarely
what is desired. An alternative is described later.
</p>
<p>To update non-conflicting and automergable files:</p>
<ol>
<li>The Structure Compare pane at the top of the Synchronize view contains the
hierarchy of resources with incoming changes.</li>
<li>Select the non-conflicting files and choose <b>Update from Repository</b>
from the pop-up menu. This will update the selected resources and remove them
from the view.</li>
<li>Select the automergable conflicts and choose <b>Override and Update</b>
from the pop-up menu. Select to only update automergable resources and click OK when prompted.
This will update the selected resources and remove them
from the view.</li>
</ol>
<p>If your local Workbench contains any outgoing changes that are not automergable
with incoming changes from the branch, then, instead of performing an <b>Override
and Update</b>, you can merge the differences into your Workbench manually,
as follows:
</p>
<ol>
<li>In the Structure Compare pane, if there is a conflict in the resource list
(represented by red arrows), select it.</li>
<li>In the Text Compare area of the Synchronize view, local Workbench data is
represented on the left, and repository branch data is represented on the
right. Examine the differences between the two.</li>
<li>Use the text compare area to merge any changes. You can copy changes from
the repository revision of the file to the Workbench copy of the file and
save the merged Workbench file (using the pop-up menu in the left pane).</li>
<li>Once you are completed merging the remote changes into a local file, choose
<b>Mark as Merged</b> from the pop-up menu. This will mark the local file as
having been updated and allow your changes to be committed.</li>
</ol>
<p><em>Note:</em> The repository contents are not changed when you update. When
you accept incoming changes, these changes are applied to your Workbench. The
repository is only changed when you commit your outgoing changes.
</p>
<p><em>Tip:</em> In the Structure Compare pane, selecting an ancestor of a set
of incoming changes will perform the operation on all the appropriate children.
For instance, selecting the top-most folder and choosing <b>Update from Repository</b>
will process all non-conflicting incoming changes and leave all other incoming
changes unprocessed.
</p>
<p><em>Warning:</em> The behavior of the <b>Override and Update</b> command described
above only applies to the incoming mode of the Synchronize view. In the <b>incoming/outgoing
mode</b> of the view, the behavior for incoming changes and conflicts is the
same but the command will revert outgoing changes to whatever the repository
contents are. Exercise great caution if using this command in incoming/outgoing
mode.
</p>
<p CLASS="Intro"><img border="0" src="../images/ngrelc.gif" alt="Related concepts" width="159" height="27"><br>
<a href="../concepts/concepts-26.htm">Team programming with CVS</a><br>
<a href="../concepts/concepts-30.htm">Synchronizing with a CVS repository</a>
</p>
<p><img border="0" src="../images/ngrelt.gif" alt="Related tasks" width="159" height="27"><br>
<a href="tasks-114.htm">Committing</a><br>
<a href="tasks-113b.htm">Resolving conflicts</a><br>
<a href="tasks-68.htm">Comparing resources</a><br>
<a href="tasks-100d.htm">Version control life cycle: adding and ignoring resources</a>
</p>
<p><img border="0" src="../images/ngrelr.gif" alt="Related references" width="159" height="27">
<br><a href="../reference/ref-47.htm">CVS</a>
<br><a href="../reference/ref-33.htm">Synchronize view</a>
</p>
<p>&nbsp;<br>
<a href="../hglegal2003.htm"><img src="../images/ngibmcpy2003.gif" alt="Copyright IBM Corporation and others 2000, 2003" border="0" width="324" height="14"></a>
</p>
</BODY>
</HTML>