将工作区的离线更改同步到 Perforce
我试图弄清楚当对本地系统进行更改时,我需要运行哪些命令才能将对工作区的更改(添加、编辑、删除)转移到 Perforce 中。
我有另一个版本控制系统,它保存我试图执行的文件:
- 从其他系统获取变更
- 集 将变更列表写入本地系统
- 告诉 Perforce 为文件夹中的所有添加、编辑和删除创建变更列表
- 中检查它们
在I 可以使用 适用于 TFS 集成平台的 PowerShell 适配器,但如何实现#3 和 #4?
我尝试过与 Perforce 服务器断开连接,但它对我不起作用。无论我需要调用什么命令都需要从 PowerShell 运行。
不过,如果需要,我可以为每个更改“添加|编辑|删除”单独调用 PowerShell 命令,但如果我可以在本地进行所有更改后仅调用一组命令,那就太好了。
我实际上希望实现与 UI 中的“协调离线工作”命令相同的效果。
- 有人知道如何实现这一目标吗?
我已经在以下时间通过以下 PowerShell 运行进行了尝试:
Initilise:
cd C:\temp\TestRun1 回声 Abcd1234 | p4 -u tfspoodrop -C utf16le-bom -Q winansi -p p4svr:1992 -c TfsSync 登录 p4 -u tfsoutput -C utf16le-bom -Q winansi -p p4svr:1992 -c TfsSync 同步 ...
添加文件:
p4 -u tfsoutput -C utf16le-bom -Q winansi -p p4svr:1992 -c TfsSync 添加 $IpNewPath
编辑文件:
p4 -u tfspoodrop -C utf16le-bom -Q winansi -p p4svr:1992 -c TfsSync edit $IpNewPath
提交:
p4 -u tfspoodrop -C utf16le-bom -Q winansi -p p4svr:1992 -c TfsSync 提交 -d $IpChangeGroup.Comment ...
我希望他的就是全部,而且我知道我仍然需要考虑分支和重命名,但是有人有更好的方法吗?
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:
- Get Changeset from other system
- Write Changelist to the local system
- Tell Perforce to create a change list for all the Add's, Edit's and Delete's in the folder
- Check them in
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.
- Does anyone know how to achieve this?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在与 Perforce Server 断开连接的情况下工作中描述的方法是正确的方法;您只需要处理详细信息即可从 PowerShell 运行它(或使用其他方法自动化它,然后从 PowerShell 调用该方法)。
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).