Chapter 1Preface
Perforce SCM system is a software configuration management tool built on a scalable Client/Server structure. Application only
TCP/IP enables developers to access the service through a variety of perforce clients (GUI, web, or command lines on several platforms ).
Perforce server. Perforce can be deployed quickly and easily. Even for large or distributed sites, the minimum limit is required.
Level management. Perforce can be used in more than 50 operating systems, including version control, workspace management, change handling, and
A powerful branch model. P4v is a cross-platform client of perforce.
1.1. Perforce Structure
1. 2. Definition of professional terms
Chapter 2 Introduction to perforce
2.1 Client Configuration
2.1.1. server connection
1. It is the first time you use p4v on your machine. The following workspace creation window appears at the beginning. Select "Create a new client"
Workspace "to create your first workspace on your local machine.
2. on the menu bar, select the "open connection" option from the "connection" drop-down menu.
3. In the following Configuration window, enter the correct server name, port, user name, password, and workspace settings as follows.
4. It should be emphasized that you must enter the workspace content during login, otherwise some operations of Perforce will not be executed normally. If you have not created a workspace, click New. The page is as follows:
5. enter the name of the workspace you created on your machine, and set the local directory and other information in the window shown in:
As follows:
Select the "modtime" option of "option.
1. After entering the information, submit the confirmation (OK) and start to connect to the corresponding server.
2.1.2 client Configuration
1.Set ①: When p4 is Enabled Next time, the path of the last exit is automatically located.
2.Set ②: When submit is enabled, only modified files are submitted without selecting unmodified files. But for unmodified files
Or manually revert.
(This function can also be used to select all submitted files in the pending changelist box, right-click, and select "revert if unchanged"
Complete .)
3.Set ③: a prompt is displayed when the file to be checked out has been checked out by someone else.
(However, if you check out the directory, no prompt is displayed)
2.1.3 main client work zone
The main interface of perforce is shown, and most operations are completed under this interface. This interface is divided into three areas:
Area 1: displays the deport and workspace content, which is called a directory area.
Area 2: lists the operation attributes of a file, which is called an operation area.
Area 3: displays the prompt information for the operation, which is called the information area.
2.1.3.1 directory
The directory area consists of the depot directory area and workspace directory area.
1. depot directory
The visible directory structure on the server is displayed (the user permission settings are different, and the visible directory is also different), which is also reflected in the workspace view.
You can specify the file path to display. Here, you can perform the following operations: Check out, submit,
Get latest revision, revert files, and other operations.
2. workspace directory
Displays the directory structure of the local workspace that is mapped to files on the server, which is also related to the workspace view.
Same as above.
2.1.3.1 Operation Zone
The content in the operation area is mainly composed of the following work areas.
1. Pending changelists Workspace
The files being modified by the current user and files being modified by other developers are displayed.
Of course, you only need to care about your own project. This information is returned when you perform operations such as mark for ADD and check out.
The status is displayed in the changlist and displayed by different icons. If the modification is complete, run the submit command
You can submit an update file, but you can also execute revert to discard the modification.
2. Submitted changelists Workspace
Shows the recent operations performed by all project team members on the project.
You can obtain information such as the changlist number, the modification time, the content of the modified file, the reason for modification, and the modifier.
3.The workspace displays all client workspaces connected to the server. In this workspace, you can create, edit, modify, and delete user workspaces. (The premise is that you have the execution permission .)
4.View the change history of a specified file in the History workspace.
5.View all the current labels in the labels workspace. In this workspace, you can create a label and modify the content. (The premise is that you have the permission to perform this operation .)
6.View All branch numbers in the branchs workspace. Create, modify, and delete branch in this workspace. (The premise is that you have the permission to perform this operation .)
In addition to the preceding work areas, there are also work areas such as files, users, jobs, details, and fild files. Including the preceding
These workspace windows can be switched through the interface, as shown in the following tabs:
2.1.3.3.Information areaA window (pane windows. Pane windows is a very useful window, called the message window area. The bottom window is. Any of your operations will be
It appears here, including success, warning, error, and other information. Especially when an operation fails, the information here is crucial.
Important. Generally, you can handle unexpected situations or nonstandard operations based on the information here.2.2.Routine operations of perforce2.2.1.Add folder and file 1.Right-click the folder/file to be added in workspace and select "mark for Add" to add the file.
Displays the added files in the pending changelists workspace. After adding folders and files to the workspace, the icon has
A red plus sign indicates that the added folder and file only exist in the client's workspace and have not been submitted to the server
Warehouse on the server. Therefore, right-click the folder or file to be submitted and select submit. After the file is submitted
To the repository on the server.
2.When submitting (submit) to add a file/folder, you need to write the description of the change during the submit process. This is very important! Detailed description information, which greatly facilitates
. The action type is described in English at the beginning of the description. For example, add is used; modify is used
Modify; build indicates compilation and so on.
Click Submit. The red plus sign in front of the file is removed and the file is displayed in the reversion column.
. In this case, a green icon is displayed in the bottom right corner of the file, indicating that the file is currently in the latest version.
2.2.2.File ModificationTo modify a file, check the file to be modified to the local machine. 1.Right-click the file to be modified and select the check out command.
At this time, a Red Hook icon is displayed in the upper-left corner of the file to be checked out, indicating that the file has been checked out successfully.
. If there is a blue hook icon in the upper-right corner of the file, it indicates that the file has been checked out. Because of the support of perforce
With parallel operations, you can check out files that have been checked out again to your local machine for modification.
2.Double-click the file that has been checked out and modify it. After the modification, right-click the file and select submit to write down the description of the change list.
3.Click Submit to submit the file to the server and add a new version. Please do not make any changes after checking out a file.
In the submit operation, right-click and select revert if unchanged. After submission, the number of versions of the file will not be increased,
Otherwise, the server adds a version to a file that has not been modified. We recommend that you think after each modification: Why do you want to make these changes? If the modification is meaningless, we recommend that you do not set
This file is submitted (submit), but revert your modifications.2.2.2.1.Merge filesThe merge operation is mainly used to solve conflicts arising from changes in the parallel development process. For example, when multiple users need to perform the check out operation on the same file at the same time, when submit the file, perforce may
Error. The following is an example: A and B must simultaneously perform the check out operation on the callkeep. cpp file.
Now we can see that the file callkeep. cpp has a hook in the upper left corner and the upper right corner, which indicates that the file is being executed by at least two people.
Check out operation. Since perforce supports parallel operations, A and B do not conflict when performing check out,
When you submit this file, an error may be reported. The first person performing the submit operation will not have problems, for example, a can submit normally,
However, if the content modified by B conflicts with that modified by a, B executes the submit command and returns an error, prompting that the server has the latest
Version (Version A submitted)
At this time, B obtains the latest version and then submits it again. An error is still reported.
A question mark is added to the file, indicating that the server does not know what to do. Because the Version Content submitted by B conflicts with that of
B.
In this case, right-click the file and select resolve.
Perforce provides three automatic solutions: "Accept merged", "accept yours", and "accept theirs ". When
However, you can also view where the conflict with others is located and manually resolve the conflict. Click RUN merge tool, as shown below
The interface shown in the figure.
Area 1: displays the content of Version A submitted, that is, the latest version on the current server. Area 2: when both the callkeep. cpp file of the check out file of A and B is displayed, the latest version of content on the server, that is,,
B. The modified base version. Area 3: displays the file content modified by B. Area 4: displays all conflicting versions of the three versions. B can modify the file and provide a solution. Select the button in the red line to determine the reserved code. After resolving the conflict, submit.
2.2.3.Query historical file versions1.If you want to query any historical version of a file, right-click the file and choose get revision. 2.Write down the version number and click get revision.
In this case, perforce extracts any historical version you want.
2.2.4.Compare the differences between the two filesThe comparison operation is mainly used to view the modifications made to a file: You can see what has been added, what has been deleted, and so on.
. 1.Compare the differences between two different files or different versions of a file. Right-click the file to be compared and select diff
Files command.
2.Set the name or version of the file to be compared, as shown in.
3.Click diff to view all the different operations shown in, including adding, deleting, or modifying operations.
Note that Perforce does not support comparison of multiple files at the moment. At the same time, if two files are compared,
If the file size exceeds 2 MB, perforce also reports an error. The following page is displayed:
Please note during the operation!
2.2.5.Synchronize files on the serverIf you find the files you need on the server and want to synchronize these files to the local machine, you must first select
Workspace workspace, right-click the folder to be downloaded, and select the get lastest revision command.
The folder has been synchronized.2.2.6.Get the label version FileExtracts files marked with specific labels. 1.The identifier found on the toolbar. In the labels workspace in the upper-right corner, locate the required label number.
2.Obtains a specific file under a specified label. Right-click the specified label and select "Get revision..." from the menu ...".
3.In the displayed dialog box, select the file to be checked out.
4.Click "add" and select the file marked with the label.
Chapter 3Notes1.The number of words in a row in the merged base file cannot exceed 6000 characters. Otherwise, an error is reported. 2.When comparing two files, the file size should not exceed 2 MB; otherwise, an error will be saved. 3.Check out check out tells the server to modify the specified file, but actually changes the attribute of the local file from read-only to writable. Note that
Do not manually modify the file information. The server does not know how to manually modify the file information. This will only cause unnecessary troubles.
The information is displayed under the defualt contact of pending changelists. 4.All File Deletion operations on perforce are completed by the configuration administrator. If you need to delete an object, delete it.
The path of the perforce file to be deleted is sent to the configuration administrator. 5.Before checking in a file, you must first check whether the type of the file to be checked in is included in the set file type (you can
In the // depot/MISC/types/typemap.txt file), otherwise, the file type contained cannot be added to the perforce configuration.
Set the database.Chapter 4Server-related installation and configuration2.1.Installation Steps1.Click the installer. The following page is displayed. Select "user installation" and click Next to continue the installation.
2.The following page is displayed. Select the component to be installed. Select All.
3.Configure the connection server port and other information.
Configuration information except username is the user's own name. 4.Finally, check and confirm the installation configuration information (including the installation path, installation components, server port number, user name, and so on ).
), Click "Install" to start installation.
5.In the Start menu, select perforce --> p4v To Go To The p4v client interface.
Address: http://blog.sina.com.cn/s/blog_6ec7264f0100netl.html