Skip to content

Code History Diff View

YoungSeok Yoon edited this page Jun 4, 2014 · 10 revisions

Overview

The Code History Diff View is a code-compare view with side-by-side panels. You can see how some region of code has evolved over time, or even revert the code to an earlier version.

The left-hand panel always shows the current (i.e., the most recent) version of the code snippet.

The right-hand panel shows some version of the code in the past, where the orange marker in the timeline is pointing at.

The diffs between the two code snippets are marked, as in usual visual diff UIs. The right side code can go all the way back to when the code did not even exist, assuming that this is in the history.

Launching the Code History Diff View

You can select an arbitrary region of code from the code editor, and invoke Launch Code History Diff command to see this view for the specified region.

Click to watch the video ↓

Watch the video

NOTE: In the current version of Azurite, the code history diff view might appear as a hidden tab stacked behind other tabbed views at the bottom of Eclipse screen. You can simply move the view to a desired location.

Navigating Through the History

There are two different ways to move back and forth through the history.

First, you can drag the orange time marker in the Timeline View with mouse to see how the code looked at the time at which the marker is pointing. This is similar to how time markers work in video editors. The code snippet shown on the right panel changes instantaneously as the marker is moved, and diffs are recalculated as well.

Alternatively, you can use the & buttons above the code to move through different versions incrementally. This is useful when there are many rectangles between versions that are irrelevant to the code snippet currently shown in the Code History Diff View. Whenever the version changes using the navigation buttons, the marker position in the timeline is also updated correspondingly.

Reverting the Code

When you want to revert the code snippet to the version currently shown in the right panel, you can do it by clicking the button. This feature can be considered as a regional undo with a preview.

Launching Interactive Selective Undo

Sometimes, instead of directly reverting the entire block with the revert button, you might want to fine-tune the selective undo results. In this case, you can use the button to launch the Interactive Selective Undo dialog.

This will automatically select all the rectangles that would have been selectively undone if you clicked the button.

Multiple Instances of Code History Diff View

Azurite allows multiple Code History Diff Views to be launched for different regions of code as separate tabs. These views can be dragged to be side-by-side or even in a window outside of Eclipse. This is useful when there are multiple code snippets coupled together around a certain feature.

In this case, all open Code History Diff Views share the same time marker in the Timeline View, and you can intuitively see how those code snippets as a whole have evolved over time.


Back to Home

Clone this wiki locally