Adding History Support

There are two parts to adding History support to your repository:

Providing History

The core history interfaces allow users to access the history of an item by querying the IFileHistoryProvider returned by the RepositoryProvider. To do this, you need to:

Showing History

To display history for items in your repository, you can provide one or more HistoryPages which will be shown in the History view. To do this, you need to:

Showing History for Sub-file Elements

To display the history of a model element that is contained in a file, you can do the following:

FileSystem History Example

The FileSystem example illustrates how you can provide history and a history page for repository items. Select a resource in a FileSystem managed project and choose Team > Show History. The FileSystem History page will be displayed in the History view with all of the local revisions as well as the FileSystem revision displayed. You can right click on any revision and select Open from the context menu to open the revision.

FileRevisionEditorInput

To support the Open functionality, the FileSystem history example had to create its own FileSystemRevisionEditorInput (see org.eclipse.team.examples.filesystem.ui.FileSystemRevisionEditorInput). This class adapts to IFileRevision and to IFileState, which can be used to determine whether the editor contains remote contents (IFileRevision) or local history contents (IFileState).

Likewise, the existing FileRevisionEditorInput's that come with the SDK and are used by the Local History page all adapt to IFileRevision which can be used to determine if the revision contained in the editor is that of a remote revision.