Perfoss Howto? Synchronize / Merge files between branches

(A) ------- (B) ----------- (C) | | | Trunk ReleaseBranch DeveloperBranch 

Developers work in the C-branch and register all files. Modified files are then tagged in branch C. Binary files that are deployed are built from a B-branch and tagged. Currently, this is all a guide.

In Perforce, is there an easy way to accomplish this, such as merging branches based on labels, etc.

+4
source share
1 answer

It is not immediately clear how much automation you already have, or how much automation you are looking for. Perforce itself provides tools for tracking integration and branching, but if you want to do things like automatic assemblies and markings, you will need to look for the outside world of version control in the world of release management.

I am going to assume that you have two branches:

 (B) //depot/yourcode/rel/... (C) //depot/yourcode/dev/... 

Inside these branches, the code layout is roughly similar, although the developer will be newer (and possibly coarser) than rel. (Your text does not explain what you are doing with the trunk, so I ignore it.)

Say you are developing dev and you want to release code. You create a shortcut (call him MYCODE_DEV.1.0 ) with the files you want to release. You can integrate it into rel:

 p4 integrate //depot/yourcode/dev/ ...@MYCODE _DEV.1.0 //depot/yourcode/rel/... 

This integrates from the label MYCODE_DEV.1.0 into the release branch. Perforce keeps track of which file changes you merged and which version of the files you did not merge, so it will only merge the new code. If you made changes to rel that were not in dev, you will need to allow the changes (automatically or manually). Then you can check the changes on rel, create a new label and release from there.

(Since Perforce keeps track of what you merged if you try to integrate the same shortcut again, Perforce will politely refuse to do anything, although you can redefine it if you think you know better).

(If you read the Perforce documentation, you will find links to “branch specifications” that allow you to declare a named branch as an abbreviation for both source and destination branches in your integration team. Industry specifications are especially useful for supporting complex branches with source files scattered across to multiple directories, but don't really add value to a simple example here.)

Perforce provides you with the tools you need to tweak your branches and releases to achieve your goals, which can be easily scripted but not automatically released automatically.

+12
source

Source: https://habr.com/ru/post/1307170/


All Articles