Skip to content
YoungSeok Yoon edited this page Jun 9, 2014 · 6 revisions

Reviewing the History of a Code Fragment

You might have the following questions while coding:

  • When and how was this code changed or inserted?
  • How exactly has it changed over time?
  • Has this code always been this way?

These questions can be easily answered by selecting the code and launching the code history diff view.

Determining What Recent Changes Were Made

You can use the Read Previous Log command, which loads the history of the past editing sessions to see what recent changes have been made to the workspace.

Since the most recently edited file is always shown at the top in the timeline, the recently changed files can be easily identified by reading the file names from the top. If more detailed information is needed, the user can Jump to the Code by double-clicking the last rectangle of each file row. Furthermore, the Code History Diff View can be used to see the actual code edits, if necessary.

Reverting LayoutManager to a Previously Used One

When programming graphical user interfaces (GUIs), one often ends up having to experiment with different layout managers to get the UI to look as desired.

Scenario:

You are implementing a GUI dialog in Java Swing. You first write the code with GridBagLayout, and then changes to a simpler BoxLayout manager because of the complex parameters that are required for GridBagLayout. Then you realize BoxLayout does not look very pretty, and wants to revert back to GridBagLayout.

This can be done with Azurite by searching for the time when GridBagLayout existed in the code snippet (using History Search), and then reverting the code to the desired version with Azurite features such as Code History Diff View or Interactive Selective Undo.

Removing Temporary Debugging Code

One popular debugging strategy is to add print or logging statements in various locations of code to see how the values changes as the program executes. In many cases, these statements are temporary and should not be committed to the main repository. Removing all the recently added println statements, however, can be a tedious task if they are spread across multiple locations. If the println statements were consecutive in the history (i.e., they were inserted at the same time), this can be done relatively easily with Azurite.

First, you can locate one of the println statements from the code editor with regular code search, for example. Then, you can identify the point in time when the statement was inserted using the Select Corresponding Rectangles command.

Since all the println insertions would appear close to each other in the timeline, they can be easily selected together and undone at once.


Back to Home

Clone this wiki locally