Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use P4VS and P4SCC together?

The project I'm working on uses a .NET Solution file, and multiple C# projects. The IDE is Visual Studio 2012, and Perforce is used for source control. The .sln and .csproj files contain the SCC binding information, for example, for .csproj files:

<SccProjectName>Perforce Project</SccProjectName>
<SccLocalPath>..</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>MSSCCI:Perforce SCM</SccProvider>

... and the .sln file:

Global
    GlobalSection(SourceCodeControl) = preSolution
        SccNumberOfProjects = 43
        SccLocalPath0 = .
        SccProjectUniqueName1 = AnotherProj\\AnotherProj.csproj
        SccLocalPath1 = .
        SccProjectFilePathRelativizedFromConnection1 = AnotherProj\\
        SccProjectUniqueName2 = MyProj\u0020Domain\\MyProj\u0020Domain.csproj
        SccLocalPath2 = .
        SccProjectFilePathRelativizedFromConnection2 = MyProj\u0020Domain\\
    ... etc ...

According to Perforce, there's a process for migrating from P4SCC to P4VS:

Migrating from P4SCC to P4VS To migrate your solutions and projects from P4SCC, the Perforce SCC Plug-in, to P4VS, you must do the following: 1. Strip the bindings from the solution (.sln) file and all of the project files (csproj, vcxproj, etc.). 2. Remove MSSCCPROJ.SCC and other source-control-specific files. 3. Move all developers to P4VS and have them uninstall the old P4SCC plug-in. For detailed instructions, see www.perforce.com/perforce/doc.current/user/p4vs_p4scc_migration.txt.

However, due to the testing status of the project, these files may not be modified. Further, some developers prefer to use P4SCC.

Whilst I understand that the official process is that the projects and solution be migrated (from P4SCC) to use P4VS, I do remember reading a comment online (for which I don't have a link) where someone asserted that he was able to use both together without modifying the project files.

Is it possible to do this without having to change the Source Control provider upon each start-up, and click through a series of warning/error messages about mismatched bindings? If so, how?

like image 808
CJBS Avatar asked Jan 27 '14 23:01

CJBS


People also ask

How do I add perforce in Visual Studio?

Installing P4VS is easy; simply download the free plug-in from the Perforce website and double-click to install it in Visual Studio.


2 Answers

Sorry, this is not possible. It is possible to have both P4VS and P4SCC installed and used with different projects, but individual projects must be bound to a single source control provider.

like image 108
p4bill Avatar answered Oct 06 '22 18:10

p4bill


I've found that you can put a condition on the SCC bindings that live in the .vcxproj, such as below, meaning that you never have to check out the .vcxproj, only the .sln, which for us never really changes.

So now I can work with P4VS whilst others work with P4SCC without ever being interrupted by annoying dialog boxes (at least after initially removing the source control from the .sln).

In the example, I just set BUILD_USE_P4VS=1 in my environment vars. Anyone using P4SCC does not.

<PropertyGroup Label="Globals" Condition="'$(BUILD_USE_P4VS)'==''">  
    <SccProjectName>Perforce Project</SccProjectName>
    <SccLocalPath>..\..\..\..</SccLocalPath>
    <SccProvider>MSSCCI:Perforce SCM</SccProvider>
</PropertyGroup>
like image 22
pjcard Avatar answered Oct 06 '22 16:10

pjcard