开发者

How to auto integrate changes to other branches

I have an auto integrate trigger set up that can integrate between about 15 branches, all within the same product. My depot is set up like

//Product/dev/main/...
//Product/dev/v1.0/...
//Product/releases/v1.0.0/...
//Product/releases/v1.1.0/...

etc. That is easy enough to integrate between. My trigger does a search and replace on these depot paths to integrate from one to the other. It gets these paths via subtasks in Jira. Now other projects want the same thing. The problem is not all projects follow the same structure. Some are more like

//ProductB/SubProject/dev/main/...
//ProductB/SubProject/dev/v1.0/...
//ProductB/releases/v1.0.0/...
//ProductB/releases/v1.1.0/...

So I can't use the same search and replac开发者_开发问答e method, because it may be different between projects. I was hoping someone might have a integrate trick I could use. Branchspecs don't appeal to me because we have over 18 products, with some products having over 15 branches. So if I create a new branch for a product, I have to create 16 branchspecs. Doable, but painful.


If I understand correctly, all //productB branches have a common ancestor, right? I think you could programmatically call p4 filelog -i and parse the output to see where it belongs to.

The -i flag includes inherited file history. If a file was created by branching (using 'p4 integrate'), filelog lists the revisions of the file's ancestors up to the branch points that led to the specified revision. File history inherited by renaming (using 'p4 move') is always displayed regardless of whether -i is specified.


Capturing this high level relationship (merge source and target) has to be captured either in a branch spec or a configuration file of some sort.

Once the new streams feature is available later this year, the parent/child relationship between two codelines will be captured directly in Perforce, making an automatic merge script much easier to write.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜