Pregunta

I have a branch in my depot that I want to copy to a parallel location that does not currently exist in the depot. (i.e. I currently have \depot\rev6.2... and I need to create another branch at \depot\rev6.2b...) There are 2 things I would like to also happen:

First, I need the changelist history from rev6.2 to copy over to rev6.2b. When I have tried using the integrate feature, I have a new branch in the depot, but the history is blank (only 1 entry from the CL I submitted to create the branch).

Second (if possible) I would like to find a quick way so that if new changes are made in rev6.2, I can easily apply them to the rev6.2b branch as well.

I am a pretty basic P4V user (2011.1), so the more details the better. Thanks in advance for any help!!

¿Fue útil?

Solución

You need to enable branch history. Click the icon I've circled in red, and select "Follow Branch Actions" in the dropdown.

How to enable branch history

Regarding your second question, if you want to bring over changes from the original branch, you can just run integrate a second time. Perforce tracks the integration history, so it knows when the branch was created, and what changes have been integrated since then (if any).

Otros consejos

Perforce keeps all the integration history, as others already mentioned so everything from the 'rev6.2b' branch will have it's history traced to the 'rev6.2' branch. The P4V Revision Graph shows all of this history visually. On the command line the 'p4 filelog' or 'p4 filelog -i' commands, for example:

$ p4 filelog //depot/rev6.2b/...
//depot/rev6.2b/bar
... #1 change 12179 branch on 2016/02/25 by super1@super2015.2 (text) 'copy'
... ... branch from //depot/rev6.2/bar#1
//depot/rev6.2b/foo
... #1 change 12179 branch on 2016/02/25 by super1@super2015.2 (text) 'copy'
... ... branch from //depot/rev6.2/foo#1

The output shows the files in rev6.2b were branched from rev6.2 directory.

I am not sure which version and OS of the Perforce server and P4V client you are using but here is some feedback.

Regarding if new changes are made in rev6.2, to easily apply them to the rev6.2b branch also you can use a change-commit trigger to do that. You could create a branchspec that has a view that maps all the changes from 'rev6.2' to 'rev6.2b' and then use the branch spec in the copy or integ command.

See Admin Guide: Change-commit Triggers https://www.perforce.com/perforce/doc.current/manuals/p4sag/chapter.scripting.html#scripting.triggers.submits.commit

EXAMPLE BRANCHSPEC

Here is a view of a branch spec named 'master6.2copy'

View:
    //depot/rev6.2/... //depot/rev6.2b/...

EXAMPLE

Here is *.bat file showing the content of a trigger script. (This is not an official Perforce script, just an example that can be tweaked.) The first line below can also be instead:

p4 -p localhost:1666 -u myuser -c mywksp copy -b master6.2copy

@echo off
::
:: Example:   The following change-commit trigger is an MS-DOS batch file
:: This trigger fires only after a changelist submission on a master directory
:: 
:: Add the following line to your triggers table:
::
:: copymaster change-commit //depot/rev6.2/... "/home/user/scripts/copyrev6-2.bat"

p4 -p localhost:1666 -u myuser -c mywksp integ -b master6.2copy
p4 -p localhost:1666 -u myuser -c mywksp resolve -at
p4 -p localhost:1666 -u myuser -c mywksp submit -d "rev6.2 copy to rev6.2b after changelist"
exit 0

Hope this helps!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top