blob: 9dbd9207fb04e010d14907e013228ed54d32bd16 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<meta content="text/css" http-equiv="Content-Style-Type">
<link type="text/css" charset="ISO-8859-1" href="../../PRODUCT_PLUGIN/book.css" rel="STYLESHEET">
<link type="text/css" charset="ISO-8859-1" href="team-cvs.css" rel="STYLESHEET">
<title>Working with conflicting changes</title>
</head>
<body>
<h3>Working with conflicting changes<br>
</h3>
<p>There are cases where two users are editing the same files and
when the second to commit to the repository tries to commit their changes, the
repository won't allow the commit to succeed because of the conflict. Let's
simulate this by making Fred and Jane change the same files.<br>
</p>
<ol>
<li class="Steps">In Fred's workspace open one of the navigation views and edit
<em class="FileName">file1.txt</em>. Make the text the following:
<pre class="FileContents">
Fred line 1
This is the contents
Fred-update
of file 1.
</pre>
</li>
<li class="Steps">Fred will also change <em class="FileName">file2.txt</em> with the following change:
<pre class="FileContents">
File2 is a (Fred was here again)
with simple text.
</pre>
</li>
<li class="Steps">Fred committed his changes to the repository.
</li>
<li class="Steps">Next, at the same time Jane was making changes to <em class="FileName">file1.txt</em>. She
added the following line to the end of the file:
<pre class="FileContents">
This is the contents
Fred-update
of file 1.
Jane was at the end
</pre>
</li>
<li class="Steps">And finally, Jane changed <em class="FileName">file2.txt</em> to the following:
<pre class="FileContents">
File2 is a (Jane was here) small file
with simple text.
</pre>
</li>
<li class="Steps">When Jane was finished making changes she synchronized the
project and found the following appear in the Synchronize View:
<img class="Big" src="../images/Image83_jane3_conflict.png" alt="Conflict shown in Synchronize view and Compare editor">
</li>
<li class="Steps">Both <em class="FileName">file1.txt</em> and <em class="FileName">file2.txt</em>
show with a red icon indicating that they have
conflicting changes. You can't commit the files until the conflicts are resolved.
Click on <em class="FileName">file1.txt</em> and notice that Fred and Jane made changes to two different
parts of the file. In this case, Jane can simply update the file and the lines
added by Fred will be merged into Jane's local file. Select <em class="FileName">file1.txt</em> and
from the context menu select <em class="UILabel">Update</em>.
</li>
<li class="Steps">Next, double on <em class="FileName">file2.txt</em> to see the conflict. In this case you can see
that both Jane and Fred changed the same line. For this type of conflicting
change a regular update can't resolve the conflict. Here you have three options
(with the command to use in brackets): accept the changes from Fred (<em class="UILabel">Override
and Update</em>), ignore Fred's changes (<em class="UILabel">Mark
as Merged</em>), or manually merge the files within the compare editor.
<img class="Big" src="../images/Image83_jane3_conflict2.png" alt="Compare editor showing conflict">
</li>
<li class="Steps">For this example, let's say Jane updated <em class="FileName">file1.txt</em> and selected
override and update for <em class="FileName">file2.txt</em>. After the operations are run the
conflicts turn into outgoing changes. Jane can review the changes and
commit them.<br>
</li>
</ol>
</body>
</html>