P4SCC, the Perforce SCC Plug-in, enables software developers to perform common SCM operations within their IDE. The plug-in functions in any environment that supports the Microsoft SCC API, most notably the Microsoft Visual Studio Suite, which we will be demonstrating in this movie.
If you installed P4V with the default settings, the P4SCC plug-in is already available. If not, browse to the Perforce downloads page, and select the SCC Plug-in from the Plug-ins and Integrations page. Run the installer, and select the P4SCC plug-in for installation.
In our example, Aruna Gupta is joining the Jamgraph project as a developer. She wants to use Visual Studio as her IDE and she will manage her source directly from that environment.
To configure her Visual Studio environment to use Perforce as the SCM provider, she chooses Tools/options/source control and verifies “Perforce SCM” is selected. If Perforce did not appear as an option, it is because she has not installed P4SCC.
To configure the behaviors for check-in and check-out, she chooses Environment. Looks like she will use the defaults. She can return and change them later if it doesn’t suit her workflow.
On the Plug-in Settings screen, she can enter her login if it not already set as default. To review and fine-tune her preferences for many other Perforce operations, she clicks the Advanced button. After a quick review, she once again sticks with the defaults.
Now that the plug-in is configured to her liking, she opens the Jamgraph project by going to File/Source Control and selecting Open from source control. The Perforce login dialog appears and she verifies the workspace that she will use for this project. In the Open Project dialog, she navigates to the folder that contains the “solution,” or .sln file for this project and selects OK, then selects the .sln file to Open.
Now the versioned files for the Jamgraph project are available to Aruna in the Solution Explorer of Visual Studio. She can perform several SCM operations from the File/Source control menu in Visual Studio, or alternatively, she can context-click on a file and access a subset of the most commonly used commands.
To edit the gparticle file, she double-clicks it to open it. As soon as she starts typing, the plug-in automatically checks it out from Perforce, as you can see from the checkmark next to the filename and its immediate appearance in the pending changelist below. This behavior was configured in the setup options previously. She makes a couple small changes, saves the file, and chooses Check in.
In the check-in dialog, she sees someone else has submitted changes since her checkout. Aruna context clicks the file and chooses Get latest revision. The plug-in displays a question mark indicating the file needs to be resolved. She context-clicks and chooses Resolve. She decides to resolve manually by running the merge tool to review and select the changes she wants. After she has completed her edits, she saves the file and closes the merge tool. Perforce asks her is she wants to accept the merged result, and she selects Yes.
She completes the changelist description, browses to a job that she wants to close, selects Submit, and the new version is now in the depot. After submission, the lock icon appears next to the filename, indicating that it is no longer checked out.
Aruna decides she wants to review the recent changes of the file so she selects it, context-clicks and chooses View History. From here she does a quick diff by dropping one version on another. Both file versions come up in the Perforce diff tool where she can quickly see inline differences or perform a search by string or line number. She also has the option of using the Revision Graph and Time-lapse View tools to display the changes between versions.
Aruna has another related project in work called Jam Wizard that is not currently under source control and she wants to add it. She chooses File/Open/Project-Solution and selects the .sln file for this project. Under the File/Source Control menu, she chooses Add solution to source control, logs in to Perforce, and checks in the .sln file and source files to be versioned.
The other files that appear in the Submit dialog are source control files that are maintained by the plug-in. These files don’t require any user management. The .suo and mssccprj file will not appear in the pending changelist and should not be versioned because they are particular to each user’s system. After the check-in is complete, the files are under source control and appear in the Solution Explorer ready for editing.
This concludes our overview of the P4SCC plug-in. You will find additional detail in the documentation section of Perforce website under “Using IDE plug-ins.”
Thanks for watching.