[原创]命令行下向perforce中添加文件
来源:配置管理之路(http://bbs.scmroad.com) 作者:laofo打开命令行窗口
引用:
Microsoft Windows XP
(C) Copyright 1985-2001 Microsoft Corp.
H:\>p4
Perforce client error:
Connect to server failed; check $P4PORT.
TCP connect to perforcebjo.scmroad.com failed.
perforcebjo.scmroad.com: host unknown.
//设置用户
引用:
H:\>set P4USER=laofo
//设置端口号
引用:
H:\>set P4PORT=PerforceProxy.scmroad.com:1667
H:\>p4
Perforce -- the Fast Software Configuration Management System.
p4 is Perforce's client tool for the command line.
Try:
p4 help simple
list most common commands
p4 help commands
list all commands
p4 help command
help on a specific command
p4 help charset
help on character set translation
p4 help environment
list environment and registry variables
p4 help filetypes
list supported file types
p4 help jobview
help on jobview syntax
p4 help revisions
help on specifying file revisions
p4 help usage
generic command line arguments
p4 help views
help on view syntax
The full user manual is available at http://www.perforce.com/manual.
Server 2005.4/156367.
//登录
引用:
H:\>p4 login
Enter password:
Success:
Password verified.
User laofo logged in.
//转到C盘,尝试添加文件
引用:
H:\>C:
C:\Documents and Settings\laofo\SCMPortal\Module>p4 add -n Patch_101_SSH_login.zip
Client 'Scmroad' can only be used from host 'scmroad-api'.//提示scmroad这个client只能用在scmroad-api这个机子上
//然后,我们指定这台机子的client
引用:
C:\Documents and Settings\laofo\SCMPortal\Module> set P4CLIENT=scmroad-laofo
C:\Documents and Settings\laofo\SCMPortal\Module>p4 add -n Patch_101_SSH_login.zip
Path ' C:\Documents and Settings\laofo\SCMPortal\Module\Patch_101_SSH_login.zip' is not under client's root 'C:\PerforceWorkingSpace'.
C:\Documents and Settings\laofo\SCMPortal\Module>cd C:\PerforceWorkingSpace\ Module
//测试一下,看看有这个文件的添加情况
引用:
C:\PerforceWorkingSpace\ Module>p4 add -n Patch_101_SSH_login.zip
//SCMPortal/release/SCMPortal/Patch_101_SSH_login.zip #1 - opened for add
//实际添加
引用:
C:\PerforceWorkingSpace\Module>
p4 add
Patch_101_SSH_login.zip
//SCMPortal/release/SCMPortal/Patch_101_SSH_login.zip #1 - opened for add
//提交所做的更改
引用:
C:\PerforceWorkingSpace\ Module>p4 submit
Change 123456 created with 1 open file(s).
Submitting change 123456.
Locking 1 files ...
Submit validation failed -- fix problems then use 'p4 submit -c
123456'.
'exJobs' validation failed: No job associated with change
123456 - refusing submission
//但是出错,提醒我们这个Changelist没有和任何的job关联
//下面我们把changelist和job进行关联
引用:
C:\PerforceWorkingSpace\ Module>p4 fix -c 123456 IS987654
Attempt to assign jobs to change no:
123456 by laofo.
IS987654 fixed by change 123456.
//再次提交
引用:
C:\PerforceWorkingSpace\ Module>p4 submit
No files to submit from the default changelist.
Use 'p4 submit -c 123456’ to submit file(s) in pending change 123456.
//提示我们利用p4 submit只是提交default changelist而不是刚才的pending changelist 123456
//这个时候,我们指定提交哪个changelist
引用:
C:\PerforceWorkingSpace\ Module>p4 submit -c 123456
Submitting change 123456.
Job fixed:
IS987654 on 2008/09/04 by john *open*
Changelist
123456 is being submitted by laofo
Job fixed:
IS987654 on 2008/09/04 by john *open*
Attempt to submit change
123456 by laofo.
add //SCMPortal/release/SCMPortal/Patch_101_SSH_login.zip #1
Change 123456 renamed change 314326 and submitted.
C:\PerforceWorkingSpace\ Module>
简单总结一下,在命令行下向perforce绑定相应job添加文件的顺序
引用:
H:\>set P4USER=laofo
H:\>set P4PORT=PerforceProxy.scmroad.com:1667
H:\>p4 login
C:\PerforceWorkingSpace\ Module>p4 add -n Patch_101_SSH_login.zip
C:\PerforceWorkingSpace\ Module>p4 fix -c 123456 IS987654
C:\PerforceWorkingSpace\ Module>p4 submit -c 123456
欢迎大家一起来交流关于配置管理方面的技术,如果有错误还请指正,谢谢。
注:转载请注明出处
回复 #1 laofo 的帖子
你好,我按照您的方法想用命令行打开perforce,打开命令行窗口
引用:
Microsoft Windows XP
(C) Copyright 1985-2001 Microsoft Corp.
H:\>p4
Perforce client error:
Connect to server failed; check $P4PORT.
TCP connect to perforcebjo.scmroad.com failed.
perforcebjo.scmroad.com: host unknown.
//设置用户
引用:
H:\>set P4USER=laofo
//设置端口号
引用:
H:\>set P4PORT=PerforceProxy.scmroad.com:1667
H:\>p4
Perforce -- the Fast Software Configuration Management System.
p4 is Perforce's client tool for the command line.
Try:
p4 help simple
list most common commands
p4 help commands
list all commands
p4 help command
help on a specific command
p4 help charset
help on character set translation
p4 help environment
list environment and registry variables
p4 help filetypes
list supported file types
p4 help jobview
help on jobview syntax
p4 help revisions
help on specifying file revisions
p4 help usage
generic command line arguments
p4 help views
help on view syntax
The full user manual is available at http://www.perforce.com/manual.
Server 2005.4/156367.
//登录
引用:
H:\>p4 login
进行到这之后,总是显示access for user 'Yonghu' has not been enabled by 'p4 protect'
能指教一下是为什么?
非常感谢 是不是你的管理员给你设置的账户和你用set P4USER设置的用户名大小写不一致啊? 多谢啊
页:
[1]