Undoing a Refactoring (Delphi)

From RAD Studio
Jump to: navigation, search

Go Up to Refactoring Applications Index

The refactoring engine takes advantage of a versioning mechanism, known as local striping, to allow you to undo renames in source code files. The IDE records the current timestamp of each file included in the current refactoring changeset. The timestamp corresponds to a specific local revision of the file. When you select the undo command, the IDE copies the local backup file that matches that timestamp back over the refactored file.

The important point to understand is that any changes that you make to the files after the refactoring will also be rolled back when you perform an Undo. Before the Undo is applied, you will get a warning message confirming that you want to apply the Undo. Applying the Undo reverts changes back to before the refactoring was originally applied in all modified files. You will lose any changes made in those files since the refactoring was originally applied.

Undo performs local striping only for Rename because Rename is the only refactoring operation that affects multiple files.

If you want to undo Extract Method, Declare Field, or Declare Variable refactorings, use Ctrl-z (regular Undo) in the Code Editor, or the Undo button in the Refactoring window, which accomplishes the same thing.

See Also