john
john

Reputation: 418

Get Perforce to auto-checkout changed files, similar to TortiseSVN?

I'm coming from TortiseSVN, where if you save a file over an existing revision it automatically gets checked out and locked for you.

However, in Perforce I have to manually checkout the file before saving it.

Is it possible to make Perforce work more like SVN in this regard?

Upvotes: 5

Views: 7594

Answers (3)

WorldTurnedUpsideDown
WorldTurnedUpsideDown

Reputation: 69

There are probably many permutations to this question, but the following worked for me. My apologies if it does not work for you (then we must have slightly different setups)

  • I am running VS2019 and P4V 2021

  • First I installed Helix Visual Client to VS

    • From VS
    • Extension => Manage Extensions => Visual Studio Marketplace
    • Search for: P4VS - Helix Plugin for Visual Studio
    • Install
  • Create VS connection to the Repos

    • From VS
    • File => Clone Repository => Helix Core Server (click link under "Browse a Repository")
    • Complete the connection information
      • Can be obtained by opening Perforce
      • Connection => Open Connections

After completing the above, whenever I edit a non-checked out file, I get a prompt "Do you wish to checkout the file"

Your mileage may vary.

Upvotes: 0

SuccessBoy
SuccessBoy

Reputation: 1

Unfortunately, from my research and these other poster's answers, it seems that the answer is "no." I'd prefer to not have to do a hack to achieve auto-checking out files on save.

Plastic (both Gluon and SCM) also support the auto-checkout feature, which is very convenient.

Upvotes: -1

Bryan Pendleton
Bryan Pendleton

Reputation: 16389

With modern versions of Perforce this is reasonably straightforward:

  1. Modify your workspace options to enable the 'allwrite' option, which specifies that you want files on your workspace to be left writable when 'p4 sync' syncs them.
  2. 'p4 sync #none' followed by 'p4 sync' to refresh your workspace and get all your files into writable mode.
  3. Before you submit, use 'p4 reconcile -aed' to have Perforce figure out which files you have modified, and open them for add/edit/delete as appropriate.

Upvotes: 6

Related Questions