Perforce's Branch and integration

Source: Internet
Author: User
Tags perforce
P4 's branching creation and integration process consists of 4 steps:

(1) Use ' P4 branch ' to create branch spec;

(2) using ' P4 integrate ' to realize the integration between branches;

(3) Use ' P4 resolve ' to complete the merger of the conflict;

(4) Submit the results of the integration using ' P4 submit '.

The following is an operation in p4v.

Create a branch spec

The following procedure creates the ProjectA main and the 2012RTM branch spec. Operation is new branch mapping.

Two Create a new branch

The following procedure creates a 2012RTM branch.

1) on Branch spec, right-click->integrate using this branch mapping

2) Submit the integration

3) after submission as follows

Integration between the three branches

The following procedure is an integration from 2012RTM to main.
1) on Branch spec, right-click->integrate using this branch mapping, pay attention to choosing the correct integration direction.

2) Right-click on conflicting files->resolve (usually choose Accept merged or Run Merge tool manual merge)

3) Submit a merger

Considerations for the four P4 integrate and P4 resolve
1) P4 Branch integration also supports the form of no branch spec, such as ' P4 integrate FromFile ToFile ', if not used branch Spec or FromFile and tofile do not have a common base when you need to use the-I parameter to force integration.

2) Use the-v parameter to ' P4 integrate ' to avoid automatically sync the results of the integrate to local, but in most cases we need to merge, so we need to sync locally.

3) Use-R for ' P4 integrate ' to represent the integration in the opposite direction of the branch spec.

4) The locally workspace file is still read-only after the ' P4 integrate ' command is defaulted, and the ' P4 edit ' command must be used first if modifications are required.

5) The ' P4 integrate ' command uses-DT-DS,-DT to indicate that the target file is deleted, but the source file is still in, the integration result is the source file;-ds indicates that if the source file is deleted, the integration result is deleted for any changes to the target file.

6) When automatically integrated in the script, you can use the-am or-as parameters for ' P4 resolve ', the difference being:
-am represents accept merged, specifically if theirs and base agree, accept yours, if yours and base agree, accept theirs, if yours and theirs are different from base, but yours and theirs do not conflict , accept the result of automatic merged, or ignore this file if yours and theirs also have conflicts.
-as is more rigorous than-am, regardless of whether yours and theirs conflict, as long as yours and theirs are different from base ignore this file.

7) After using ' P4 resolve-am ' or ' P4 resolve-as ', you can use ' P4 resolve-n ' to see files that are not automatically merged ignored, if there is no automatic merge file, you need to merge manually, otherwise you can submit directly.

8) Example: P4 integrate-b%branchname%-dt-ds

P4 Resolve-am P4 Resolve-n

P4 submit (If the P4 resolve-n command detects that no file merge has failed, submit can be executed automatically, otherwise it will need to be manually merge and then submit)

Finish.

Http://www.cnblogs.com/itech/archive/2011/08/09/2132443.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.