serge icon indicating copy to clipboard operation
serge copied to clipboard

Perforce VCS plugin

Open prat0088 opened this issue 7 years ago • 3 comments

This is an issue to discuss the Perforce VCS plugin I'm currently working on.

Notes:

  • No new Perl dependencies are required.
  • I haven't tested on Windows, but I didn't use any OS-specific syntax, so I expect it to work without change.
  • I decided to use the command-line p4 program and not the Perl API because the former will be much simpler for Serge users. The P4 Perl API is only available on Perforce's site, and it requires that you download or compile the p4 binaries separately before making the Perl module. The binaries required are 4 years old and only available by special request from Perforce's help desk.
  • This plugin will require Perforce 2012.1 or later because it depends on the reconcile command.
  • Each repository_url is expected to be a p4 filespec (eg. //depot/some_project). It will sync all files under that path by default, but the user can add additional filespecs with wildcards in the config file to selectively sync files.
  • A client will automatically be created. Its name will be customizable in the configuration.
  • I have something working reliably during brief testing.

Feedback is welcome.

prat0088 avatar Dec 27 '16 23:12 prat0088

Can we have some documentation on how to use this plugin? I tried to use this, but keep failing and bit confusing.

Here is some more detail on what I did with this plugin.

The below test was done under Windows environment. path: d:\project\depot\source Under this 'source' folder en.json is the English source and de.json and ja.json localized files are thre. I'm still new to Serge so this is my understanding on how Serge works. The Serge command is in following order. 0. serge pull --initialize <config.file>

  1. serge pull <config.file>: This will pull the updated strings to local from SVC.
  2. serge localize <config.file>: This will update delta strings to the localized file set
  3. serge push-ts <config.file>: This command will push the localized files to Pootle
  4. strings localized in Pootle.
  5. serge pull-ts <config.file>: This command will pull down fully localized strings from the Pootle
  6. serge push <config.file>: This command will check-in/push the updated and localized files back to SVC.

FYI. I'm still setting up the Pootle side, so I cannot run the #3, #4 and #5 commands yet. When I tried with git plugin, #1 > #2 > #6 process worked fine. However, with p4 plugin, #1 worked fine then when I ran #2, it failed to generate/update the localized files with the delta strings. These files are still with 'read only' attribute, it failed to write files. If I delete the localized read only files and run #2 command, it does generate localized files with delta strings. Then I ran #6, it says there no file to reconcile and just force sync all the files.

I'd love to test out this plugin, but not sure what to do. Any tip, info or documentation will help.

whereisjim avatar Mar 13 '17 21:03 whereisjim

@whereisjim

Congratulations for being the first person to test and report on using this plugin. Thanks for taking the time to comment this issue.

What version number of Perforce are you using? I wrote the plugin using

p4 -V Perforce - The Fast Software Configuration Management System. Copyright 1995-2013 Perforce Software. All rights reserved. Rev. P4/LINUX26X86_64/2014.1.community/576838 (2013/01/17).

Did you create the p4 client on your own or did you do it through serge's --initialize? The plugin should be setting the files to clobber so they are writable. See: https://github.com/evernote/serge/pull/55/files#diff-a2349dbf0c0ee9ffb89ecf0ad20d277eR95

Are those the options you see in the p4 client that was created?

There are still a few rough spots I'm trying to polish before it's ready to merge.

prat0088 avatar Mar 14 '17 07:03 prat0088

I wonder if anything has changed since Perforce introduced their Helix4git product. My understanding is that one can expose any part of Perforce repo as a Git repo, and use git toolchain / git Serge sync plugin. Has anybody tried that?

iafan avatar Aug 05 '19 21:08 iafan