Environment variables:
Export P4PASSWD=ABCDEFG
Export p4client=dyoldfish.com//This is WORKSPCE
Export P4user=dyoldfish
Export p4port=192.168.1.198:1666
Command:
1, P4 client #配置本地信息, where the file download is configured in this area, root
2, p4 sync #从perforce download files
3, P4 login #登陆perforce
4. P4 Help #显示关于命令的帮助
5, P4-h #显示关于p4的帮助
6, P4 labels ... #显示和这个目录相关的标签
7, P4 sync @dyoldfish_label #同步标签dyoldfish_label中的所有文件
8, P4 files @dyoldfish_label #查看标签dyoldfish_label所包含的文件列表
9, P4 revert #回复所有打开的文件
10, p4 revert-n ... #回复所有打开却没提交的文件
11, P4 branch Dyoldfish_brach #新建分支
12, p4 Integrate-b Dyoldfish_brach #合并分支dyoldfish_brach中描述的文件
13, P4 opened #查看打开的文件
14, p4 help commands #查看p4所有命令的帮助
15, P4 dirs-h. #显示当前目录
16, p4 branches #显示所有的分支
17. P4 Delete filename #从p4删除文件
18, p4 changelists-l ... #显示当前目录下面所有文件的修改注释
19, P4 label Dyoldfish_label #新建标签 Dyoldfish_label, edit label
20, p4 tag-l Dyoldfish_label ... #把当前目录下面的所有文件添加到标签 dyoldfish_label
21, p4 changes ... #当前目录的changelist
22. P4 Sync @10931 #sync file @changelist
23, P4 sync ... @10929 #only sync localfile@changelist
24, p4 help revisions #查看关于文件范围的帮助
25. P4 edit FileName Edits the file, which is equivalent to check out in the graphical interface
So we often use it to sync P4 sync.
Edit, P4 Edit, and then submit P4 submit-d "description" filename or dir, of course, before submitting the best to see which files are check out, so as to avoid misoperation, we can use P4 opened.
P4 unshelve-s 323071 is the file that someone else shelve go down, but not check out
Export a good variable, and then configured with 1, you can use P4 sync to download the code such as P4 sync//depot/proj1/...@21
./P4 Sync//xms/ss7_mainline/hmcallanalyzer/java/com/empirix/hm/realtime/commandbar/... Directory
./P4 Sync//xms/ss7_mainline/hmcallanalyzer/java/com/empirix/hm/realtime/commandbar (file)
If CommandBar is a directory then add/..., if it's a file, don't
Using P4 on a virtual machine
It is divided into the following steps:
1. To use P4 on Linux, you need the virtual machine to be able to access the extranet
2. Installation and Configuration P4
3. Configure the source code environment
Here is a detailed description of each step: (I call our work machine itself "host")
1. Configure the virtual machine to access the external network. Set the steps as follows
1) Shared host network card
Local connection-"Properties-" advanced-"choose to allow other networks to pass this ... and select Home Network connections for VMware network Adapter VMnet1
2 Set up virtual machine IP information
Choose traditional ....
3) Set static IP
IP 192.168.0. Xxx
Subnet Mask 255.255.255.0
DNS 192.168.0.1 (Edit/etc/reslove.conf)
Default Gateway 192.168.0.1
2. Installation and Configuration P4
1 Download Client http://www.perforce.com/perforce/downloads/index.html I am using the perforce command-line client (P4)
2 Put the client in the folder/usr/local/bin. This allows you to use the P4 command directly in any directory
3 Configure the client, there are many ways to help online, I use the configuration file method. Steps are as follows
A. Create a new folder P4config (customizable) under/usr, and create a new file P4.configfile inside the folder.
B. With vi clocking P4.configfile, enter the following configuration
p4client= (define your work space, such as YGXU_XMS)
p4passwd= (Your password)
p4port=10.12.33.133:1700
P4user= (your username)
Save exit.
C. Configure environment variables. You need to reboot this before it takes effect.
Open/etc/profile with VI, add at the end
#
# Pv4 config file path
#
If Test-z "$P 4CONFIG"; Then
Export P4config=/usr/p4config/p4.configfile
Fi
D. Test environment configuration success
Command P4 info, if the connection information is displayed, OK, otherwise you will be prompted not to connect
3. Configure the source code environment
Using the command P4 client will have the following information displayed
Client: The workspace you configured above
UPDATE:2010/01/19 20:38:36
ACCESS:2010/01/21 02:57:38
Owner: Your username
Host:linux
Description:
Created by Ygxu.
Root:/home/hammer
Options:noallwrite noclobber nocompress Unlocked Nomodtime Normdir
Submitoptions:submitunchanged
Lineend:local
View:
....
xms/ss7_mainline/...//arthur_xms/xms/ss7_mainline/...
....
Two places need to be modified:
A. Root. This determines where your code will be placed, as above, mine is/home/hammer
B. View. What kind of code do you need to take down, because generally will not take all the code down, on Linux we generally only need XMS ss7_mainline, so the other deleted, modified to the above appearance
Notice, must ensure that the space is sufficient, suggest first delete the original ss7_mainline, use the Shrink tool to reclaim space and then take the code.
Well, use the P4 Sync command, and you can go on working.
For instructions on P4 use, the documentation is as follows:
Http://www.perforce.com/perforce/technical.html
More detailed command Format reference http://www.perforce.com/perforce/doc.current/manuals/cmdref/index.html
P4 Client Download http://www.perforce.com/perforce/downloads/index.html
This paper turns from http://blog.csdn.net/dyoldfish/archive/2007/08/28/1761940.aspx