How does Visual Studio's source control integration work with Perforce?

后端 未结 9 727
轻奢々
轻奢々 2020-12-07 08:18

We\'re using Perforce and Visual Studio. Whenever we create a branch, some projects will not be bound to source control unless we use \"Open from Source Control\", but other

相关标签:
9条回答
  • 2020-12-07 08:50

    After experimenting with Milan Gardian's very informative answer, I think I can provide a simpler solution to get it working pretty well.

    As Weeble mentioned, the SAK values work fine when everything else is set up correctly, and they are often the default values (but I think it depends on which project type it is). If they do not show up in your project, just paste in this property group.

    <PropertyGroup>
        <SccProjectName>SAK</SccProjectName>
        <SccProvider>SAK</SccProvider>
        <SccAuxPath>SAK</SccAuxPath>
        <SccLocalPath>SAK</SccLocalPath>
    </PropertyGroup>
    

    Add these two lines to the *.sln in the SourceCodeControl GlobalSection. As long as the project files have SAK values, they should inherit the names from the solution.

    SccProjectName0 = Perforce\u0020Project
    SccProvider0 = MSSCCI:Perforce\u0020SCM
    

    No *.vssscc, *.vspscc, or *.SCC files need to be checked in (though they will be generated when the solution is opened).

    0 讨论(0)
  • 2020-12-07 08:52

    This is not a Perforce issue, it is a Visual Studio issue. The ridiculous requirement that source files be modified to allow Visual Studio to understand that there is an SCM tool in use is idiotic.

    The simple answer is 'stop using the Visual Studio source control integration'. It just plain sucks. Even with TFS it just plain sucks.

    If you want to be able to check out from within Visual Studio, just create a custom tool. A simple call to 'p4 edit' with the appropriate VS variable is all you need. Want to revert a file? Same idea...call p4 revert with the appropriate variable. Done.

    Use p4v to manage your source control needs (submissions, history, diffs, etc.) Visual Studio rocks as a source editor. It sucks as an SCM interface.

    0 讨论(0)
  • 2020-12-07 08:57

    Just to keep this current - the P4VS plugin has been rewritten circa 2012

    Now you can perform all of your daily interaction with Perforce naturally, like checking in code and viewing file history, directly from the IDE.

    If you’re a power user looking for a bit more, P4VS won’t disappoint. P4VS is fully compatible with Perforce Streams, and the Stream Graph is accessible from the IDE, along with Time-lapse View and Revision Graph. If you are responsible for branch management, you can merge from P4VS as well.

    And, if you work remotely or want to do a little private branching, P4Sandbox can be configured through P4VS.

    • P4VS page on perforce.com
    • Webinar on how to use it
    0 讨论(0)
提交回复
热议问题