views:

357

answers:

3

I'm using a Visual Studio (2005) + Perforce combination for a particular solution, and I'd like to manually modify a Perforce parameter (the client name).

From VS's "Change Source Control" dialog it seems that SCM info is saved per-project; however, the .csproj.vspscc files don't seem to hold any Perforce-related information, and neither does .vssscc

Here's how a .vspscc file looks like:

""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
}

The last line suggests the SCM settings are stored externally, but where?

+1  A: 

For your local working copy, Perforce stores the connection info in the MSSCCPRJ.SCC file. It looks like this:

SCC = This is a source code control file

[Solution1.sln]
SCC_Aux_Path = "P4SCC#<host>:<port>##<user>##<client hostname>"
SCC_Project_Name = Perforce Project

[Project1.csproj]
SCC_Aux_Path = "P4SCC#<host>:<port>##<user>##<client hostname>"
SCC_Project_Name = Perforce Project

There is also some information in the .sln file that can carry over between users, possibly for legacy reasons. This may be used if the MSSCCPRJ.SCC file is unavailable.

How much P4 uses or ignores those settings are dependant on their implementation.

Darcy Casselman
A: 

Open vcproj file on a text editor and locate entries starting with Scc (SccProjectName, SccAuxPath, SccLocalPath, SccProvider...). These entries define the SCC binding of the project.

As an example, a project controlled by Source Safe looks like this:

SccProjectName="&quot;$/Services&quot;. TPCAAAAA"
SccLocalPath=".."
SccProvider="MSSCCI:Microsoft Visual SourceSafe"

A project controlled by SVN looks line this:

SccProjectName="Svn"
SccAuxPath="Svn"
SccLocalPath="Svn"
SccProvider="SubversionScc"

sln files have similar entries that you can check

jrbjazz
Another reason to hate Visual Studio's SCC plugin. They store version control information in the project file. Madness!
raven
It stores information in the proj files if the SCC plugin implementor doesn't implement the MSSCCPRJ.SCC functionality. I guess SVN doesn't. (You're better off using AnkhSVN anyway).
Darcy Casselman
+1  A: 

Note you can set the P4CLIENT environment variable to tell Perforce what client you want to use; this doesn't quite answer your question but maybe it's another way to solve your problem.

Also, if you're doing Perforce with Visual Studio, you might check out the NiftyPerforce plugin (http://code.google.com/p/niftyplugins/wiki/NiftyPerforceDocumentation), which I've always found a little nicer than the one from Perforce.

jblocksom
+1 for the tip about NiftyPerforce
Cristi Diaconescu