Reputation: 23434
I am trying to figure out what commands I need to run in order to get the changes to a workspace (add, edit, delete) into Perforce when the changes were made to the local system.
I have another version control system that holds the files for which I am trying to:
I can achieve #1 and #2 using a PowerShell Adapter for the TFS Integration Platform, but how do I achieve #3 and #4?
I have tried Working Disconnected From The Perforce Server and it has not worked for me. Whatever commands I need to call need to be run from PowerShell.
I can however call a PowerShell command for each of the changes "Add | Edit | Delete" individually if I need to but it would be nice if I could just call one set of commands after all of the changes have been made locally.
I effectively want to achieve the same as the "Reconcile Offline Work" command in the UI.
I have had a stab at it with the following PowerShell run at the following time:
Initilise:
cd C:\temp\TestRun1 echo Abcd1234 | p4 -u tfspoodrop -C utf16le-bom -Q winansi -p p4svr:1992 -c TfsSync login p4 -u tfsoutput -C utf16le-bom -Q winansi -p p4svr:1992 -c TfsSync sync ...
Add File:
p4 -u tfsoutput -C utf16le-bom -Q winansi -p p4svr:1992 -c TfsSync Add $IpNewPath
Edit File:
p4 -u tfspoodrop -C utf16le-bom -Q winansi -p p4svr:1992 -c TfsSync edit $IpNewPath
Commit:
p4 -u tfspoodrop -C utf16le-bom -Q winansi -p p4svr:1992 -c TfsSync submit -d $IpChangeGroup.Comment ...
I am hoping that his is all there is to it, and I know that I still need to take into account Branches and Renames, but does anyone have a better way?
Upvotes: 1
Views: 1135
Reputation: 16359
The approach described in Working Disconnected From The Perforce Server is the right approach; you just need to work through the details to run it from PowerShell (or automate it using some other approach, which you then in turn invoke from PowerShell).
Upvotes: 1