VideosXML Three Way Diff


This demonstration will show you how the three-way comparison feature works in oXygen and how you can use it with file versioning systems.


00:00:07Starting with version 18.0 Oxygen XML Editor introduced a three-way comparison feature
00:00:13to help you solve conflicts and merge changes between multiple modifications.
00:00:19It is especially helpful for teams that have multiple authors who make changes to the same
00:00:25file at the same time, which might result in conflicts. Finding what has been modified
00:00:31by each person can be difficult.
00:00:34The Diff Files tool provides a comparison between your change to a particular file,
00:00:39another change to the same file, and the original base revision for that file.
00:00:47Some additional advantages include: You can visualize and merge content that was
00:00:52modified by you and another member of your team.
00:00:56You can easily see the differences even when the document structure has been rearranged.
00:01:03It allows you to merge XML-relevant modifications.
00:01:07In the first part of the demonstration we'll show you how the Diff Files tool works using
00:01:12two versions of the same base file. This is to demonstrate the possible use case of wanting
00:01:18to compare files when all the versions are stored locally.
00:01:23The second part of the demonstration will show how the Diff Files tool works in conjunction
00:01:29with file versioning systems. We'll show how to integrate the Diff Files
00:01:33tool with SourceTree over a Git repository and how to use it with Syncro SVN Client over
00:01:40an SVN repository.
00:01:43In our first example we'll see the differences between two revisions of the same file that
00:01:48are modifications of the same base file.
00:01:52This file represents the base, or the file that spawned the other two versions.
00:01:58Now we start the Diff Files tool, and select the two versions of the file that we want to compare.
00:02:10Note that the three-way diff mode is not yet
00:02:13enabled, meaning that the files are compared in two-way mode.
00:02:18To activate the three-way comparison mode, press this button. Note that a new input box
00:02:24is now displayed that allows you to select the base file (also known as the ancestor
00:02:30file). Now we press the "Perform File Differencing"
00:02:33button to start the comparison. Notice that the incoming changes, outgoing
00:02:40changes, and conflicts are presented with different colors.
00:02:44By default, a blue color represents incoming changes, a grey color for outgoing changes,
00:02:53and red for conflicts. For a three-way comparison there are 3 algorithms
00:02:59available: "Lines", which computes the differences at
00:03:03line level, meaning that it compares the files looking for identical lines of text."XML Fast",
00:03:11which works well on large files or fragments. And..."XML Accurate", which compares two XML
00:03:19files or fragments looking for identical XML nodes. It is more precise than XML Fast, but
00:03:26at the expense of speed and memory.
00:03:29Note that if "Auto" is selected, oXygen automatically chooses the most appropriate algorithm based
00:03:35on the size and type of the files to be compared. After the algorithm is applied and the differences
00:03:42are displayed, you can merge blocks of changes at once or individual modifications using
00:03:50in-place actions.
00:03:57When one of the XML algorithms is used, you can choose to ignore certain changes in various
00:04:03XML nodes by setting options in the Files Comparison preferences page.
00:04:09In our case, we will choose to ignore the text content and the comments from the compared
00:04:15documents.This way we can focus just on the structural changes.
00:04:33You can also choose to filter out all the nodes by using an XPath expression. For example,
00:04:40let's say that we want to ignore all ID values set in the document.
00:04:58Now, for the next part of the demonstration, we want to show you how to start the Diff
00:05:03Files tool directly in three-way mode.
00:05:07One way to do this is from the Project view by selecting the 3 files. The first selected
00:05:13file will be opened in the left panel, the second file in the right panel, and the third
00:05:19one will be the base file.
00:05:31Another way to start the Diff Files tool in three-way mode is to use parameters in a command-line
00:05:37script that will pass the paths of the files to be compared to the tool. The script line
00:05:44would look like this:
00:05:46[path to left file] - will be added in the left panel
00:05:51[path to right file] - will be added in the right panel
00:05:55[path to ancestor file] - will be the base file.
00:06:00Note that if the base file is missing, the Diff Files tool will start in two-way comparison
00:06:05mode. Otherwise, it will start in three-way comparison mode.
00:06:16As a possible use case, you can integrate the Diff Files tool with a file versioning system.
00:06:22For example, you can integrate it with SourceTree as an external diff tool and as a merge tool.
00:06:36Now, using the external diff action you can see the modifications side by side.
00:06:49You can also see the modifications made on the repository at a certain revision.
00:06:53For example, we'll check what has been modified at this revision, by comparing the commited version of a file with its previous one.
00:07:06You can notice that the differences are presented side by side, this allowing you to spot the exact changes more easily.
00:07:15You can also solve the conflicts.
00:07:17In another project in our demonstration, notice that we have a conflict in the flowers.xml file.
00:07:25From the contextual menu we select the "Resolve conflicts->Launch External Merge
00:07:30Tool" action to start the Diff Files tool. Now we can easily see the changes (incoming,
00:07:37outgoing, and conflicts) and we can solve them with some simple actions.
00:07:48Please note that before you close the application you need to always save the content of the merged
00:07:54file since this is not done automatically.
00:07:57In our case, this involves copying the content of the file where we merged the changes.
00:08:03Then we open the coflicting file in oXygen and paste the content copied earlier.
00:08:15As another possible use case, the Diff Files tool is also integrated in the Syncro SVN Client.
00:08:21After synchronizing the local working copy with the remote repository, we have a
00:08:27conflict between a remote and local version of an XML file. To start the comparison between
00:08:34the two versions relative to the base, we simply double-click the file name.
00:08:40Note that the Compare view in Syncro SVN Client is integrated as a three-way comparison, so
00:08:45it's automatically activated. All the features that are included in the Diff
00:08:50Files tool are also available in Syncro SVN Client, such as the three-way comparison algorithms,
00:08:57the various options, and the XPath filtering.
00:09:06And this concludes our demonstration. Thanks for watching!