星空网 > 软件开发 > ASP.net

Perforce 与Source Insight, Visual Studio集成


转自:http://shashanzhao.com/archives/837.html

1.Perforce

 

首先需要为perforce设置系统环境变量,以便perforce命令行可以正常使用.

环境变量名
P4CLIENT填写你的workspace的名字,例:code_myname
P4PORT填写perforce服务器地址和端口号,例:172.23.3.3:1666
P4USER填写你的用户名,例:myname
P4DIFF(可选)填写比较工具的路径,例: d:\Programs\BeyondCompare\BCompare.exe,如果使用perforce自带的比较工具就不用设这个环境变量了
P4PASSWD填写登陆的密码,例:password

 

 

2.集成至Source Insight

 

1. Source Insight菜单Options->Custom Commands,

选择以下各个Command,填写各个Command的Run.

Command:Run:
Check Outp4 edit %f
Undo Check Outp4 revert %f
Sync File to Source Control Projectp4 sync %f
Compare with Currentp4 diff –f %f

其中Compare with Current命令需要自己添加.

点击Add按钮, 填入命名: Compare with Current即可添加一条.

Perforce 与Source Insight, Visual Studio集成

另外Compare with Current必须在check out状态下才能比较,比较的就是未check out出来时的文件.

2. 填完后Custom Commands窗口不要关,点击Menu按钮

将刚才的那些命令添加到work菜单下.

操作方法:

a.右边的Menu组合框中选择Work

b.左边窗口选中命令,右边窗口选中<end of menu>,

c.点击Insert按钮把命令插入work菜单下

d.重复b-c,直至所有命令添加完毕

e.按下OK按钮

3. 打开文件,在work菜单下就可以选择Check Out, Undo Check Out, Sync File to Source Control Project, Compare with Current等菜单来操作文件了

另外也可以打开Source Control工具栏,通过主菜单View->Toolbars->Source Control,

在Source Control工具栏上默认有Check Out, Undo Check Out, Sync File to Source Control Project等按钮.

Perforce 与Source Insight, Visual Studio集成

 

3.集成至Visual Studio

 

1. Visual Studio菜单:工具->外部工具,

添加以下各个工具,填写各个工具的标题,命令和参数.注意添加时选中使用输出窗口.

标题:命令:参数:
Check Outp4.exe的路径,例:C:\Program Files\Perforce\p4.exeedit $(ItemPath)
Undo Check Outp4.exe的路径revert $(ItemPath)
Sync File to Source Control Projectp4.exe的路径sync $(ItemPath)
Compare with Currentp4.exe的路径diff –f $(ItemPath)

Perforce 与Source Insight, Visual Studio集成

2. 打开代码后,在”工具”菜单下可以找到新增加的菜单.

3. 还可以在”工具”->”自定义”中把外部命令拖到工具栏上,方便使用.

Perforce 与Source Insight, Visual Studio集成

注意:在自定义中只显示外部命令+数字,所以先要看一下新加的外部命令排在第几个,然后选择对应的外部命令(例:外部命令10)拖到工具栏上即可.另外各个版本的Visual Studio的自定义可能会有些区别,我所测试的是VS2005.




原标题:Perforce 与Source Insight, Visual Studio集成

关键词:Visual,Studio

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

美通国际物流:https://www.goluckyvip.com/tag/101293.html
51track国际物流:https://www.goluckyvip.com/tag/101294.html
港通国际物流:https://www.goluckyvip.com/tag/101295.html
得一国际物流:https://www.goluckyvip.com/tag/101296.html
国际货运速递:https://www.goluckyvip.com/tag/101297.html
德班国际物流:https://www.goluckyvip.com/tag/101298.html
37号文今后是否会更新?一文详解关键信息 :https://www.kjdsnews.com/a/1836441.html
探讨内地人开设香港账户的可行性 :https://www.kjdsnews.com/a/1836442.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流