Using the History Manager

From RAD Studio
Jump to: navigation, search

Go Up to How To Edit Code in the Code Editor

The History Manager lets you view and compare versions of a file, including multiple backup versions, saved local changes, and the edit buffer of unsaved changes.

Note: For information about using a version control system in the History Manager, see:

For simplicity, this topic is written as a tutorial that uses a small text file to introduce the functionality of the History Manager. However, the History Manager is available for most files, including source code and HTML or XML files.

Tutorial Step 1: To create and display file versions in the Contents page

  1. Choose Tools > Options > Editor Options page and verify that the Create Backup Files option is checked.
  2. Choose File > New > Other > Other Files > Text File and click OK to display a blank text file in the Code Editor.
  3. On line one of the file, type First line of text and save the file using any name and location.
  4. On line two, type Second line of text and save the file.
  5. On line three, type Third line of text and save the file. There are now three versions of the file stored in the current directory in a hidden directory named __history.
  6. Click the History tab, which is next to the Code tab. The revision list at the top of the Contents tab displays three versions of the file. The first version is named ~1~, the second is named ~2~, and the current version is named File. The source viewer at the bottom of the tab displays the source for the selected version.
  7. Select the different versions to display their source in the source viewer.
  8. Click the Code tab to return to the Code Editor and on line four of the file, type Fourth line of text but do not save the file. Your change is stored in the editor buffer, but not saved to the file.
  9. Review the following toolbar and icon descriptions and then use the next procedure to compare the file versions that you just created.
Tip: To sort a column on any page of the History Manager, click the column heading.

Tutorial Step 2: To compare file versions using the Diff page

  1. Using the file that you created in the previous procedure, click the History tab.
  2. Click the Differences tab at the bottom of the History Manager.The Differences From and To panes at the top of the page shows the file versions that you can compare. At the bottom of the page, source lines that were deleted are highlighted and marked with a minus sign (-). Lines that were added are highlighted and marked with a plus sign (+). The highlighting colors depend on the Code Editor colors.
  3. Select the different file versions in both the Differences From pane and the To pane to see the results in source viewer.

Tutorial Step 3: To make a prior file version the current version

  1. Using the file from the previous procedures, click the Contents tab.
  2. Right-click the ~2~ version of the file and select Revert, or click the Revert toolbar button.The Confirm dialog box indicates that reverting the file will lose any unsaved changes in the buffer.
  3. Click Yes on Confirm dialog box. The ~2~ version becomes the current version.
  4. Return to the Code Editor and save the change.
Tip: The Revert command is also available on the Info page.

See Also