Placing Projects Under Version Control
Introduction
AccuRev Plug-In for IntelliJ IDEA provides access to AccuRev version control commands within IntelliJ IDEA . The commands executed by the Integration move data between a central source-code repository (a depot) and a personal AccuRev work area (a workspace). AccuRev can manage an IDE project’s files if (and only if) the project’s location on disk is within an AccuRev workspace. It doesn’t matter which is created first, the IDE project or the AccuRev workspace.
Also relevant is this aspect of AccuRev’s data architecture: AccuRev does not automatically version control every file within an AccuRev workspace. For example, version-controlling text-editor backup files would be a waste of resources. Files created in a workspace initially have (external) status. They become version-controlled elements when explicitly processed with the Add to AccuRev Depot command.
Before Placing Projects Under Version Control
Make sure that AccuRev depots and streams have been created and properly configured. These operations cannot be performed within IntelliJ IDEA.
Use Cases
Case 1: An IntelliJ IDEA project already exists and you want to make AccuRev its version control provider
Perform the procedure in the section Making AccuRev the Version Control Provider for an Existing IDE Project.
Case 2: Your sources are already under AccuRev version control and you want to use IntelliJ IDEA for development
If you have access to an AccuRev workspace containing the sources, perform the procedure in Creating a New IDE Project in a Workspace.
If you need to create a new AccuRev workspace containing the sources, perform the procedure in Creating a Workspace for Sources that are Already Under AccuRev Version Control.
Case 3: Your sources are located in an AccuRev workspace and an IntelliJ IDEA project exists for the sources
Click File > Open Project, navigate to the project file (.ipr), and click OK.
Making AccuRev the Default Version Control Provider for New IDE Projects
- Close any open projects.
- Click File > Settings from the IntelliJ IDEA main menu.
- Expand the Version Control node.
- In the Version Control list, select AccuRev.
Making AccuRev the Version Control Provider for an Existing IDE Project
You might want to use AccuRev selectively, for some new projects but not others. Or you might have existing projects to be used with AccuRev. This procedure handles both of these cases:
- Arrange for the project files to be located within an existing
AccuRev workspace, in either of these ways:
- Move all the project files from their current location to a location within an existing AccuRev workspace.
- Use the AccuRev GUI to convert the project’s current disk location, or a higher-level directory, into a new AccuRev workspace (File > New > Workspace command).
In either case, the project’s root directory need not be the top-level directory of the workspace.
- Open the project in IntelliJ IDEA .
-
Click File > Settings from the IntelliJ IDEA main menu.
-
Expand the Version Control node.
-
In the Version Control list, select
AccuRev
. - If you moved data into an existing workspace or created a new workspace, as outlined in Step 1, you must place the project’s files under version control. See Converting (external) Status Files to Version-Controlled Elements.
Creating a Workspace for Sources that are Already Under AccuRev Version Control
- Click
Version Control > Checkout from Version Control > AccuRev or select
Checkout from Version Control > AccuRev from the
IntelliJ IDEA
Quick Start menu. If you are using the
accurev_login
authentication mode, you might be required to log in at this time. - On the Checkout From Version Control screen, specify an AccuRev depot, a stream within that depot, and a name for the new workspace. AccuRev automatically adds your username as a suffix to the name you enter (unless you type the suffix yourself). Click Next.
- On the Workspace Properties screen, accepting the defaults is often most appropriate. See the description of the anchor command for a discussion of the exclusive file locking and anchor required features. Click Next.
- On the
Workspace Directory screen, click the
Browse button and navigate to an existing directory.
The new workspace will be created as a subdirectory at the location you specify. The subdirectory name is the same as the workspace name you specified on the first wizard screen.
- IntelliJ IDEA automatically proceeds to create an IDE project in the new AccuRev workspace:
- Click Yes to complete the process.
Creating a New IDE Project in a Workspace
This is essentially the standard IntelliJ IDEA procedure for creating a new project, with a little extra work at the end.
- Choose
Create New Project from the
Quick Start menu, or click
File > New Project on the IDE’s main menu.
The New Project dialog box appears.
- Enter a Project name, and specify a Project location that is within an existing AccuRev workspace. You can create the project in the workspace’s top-level directory, or in a subdirectory.
- Continue through the wizard’s screens, ending with Finish.
- Make sure that AccuRev is the version control provider for the new project. See .
- Make sure that the files in the project are version-controlled elements. See .
Converting (external) Status Files to Version-Controlled Elements
- Click AccuRev > Searches > External to list the workspace’s external files at the bottom of the IDE window.
- Select the
(external)-status files that you want to convert to version-controlled elements.
Tip: You may want to click Edit > Select All.
- Click
Add to
AccuRev Depot.
The newly created elements have (kept) status.