How to find out where the original listing is original from Perforce

In Perforce, we do a lot of forking and merging. How can we know the original changelog that there is one change?

For example, I posted a changelog with ID 53343 in my own private branch, and two days later it was merged into a branch of corporation A, and then a week later it was merged into an integration branch B and eventually it merges into the main branch. Now the changelog ID is completely different, say 55445, because it's a merge that actually includes many changelists, maybe 300, besides mine.

How can I get the original "53343" now?

Below is a more detailed description.

For example, I want to know the change history for a single file in a depot range.

$ p4 changes //prod/main/platform/abc.txt
Change 560938 on 2017/04/13 by user1@user1:main 'bug fix2'
Change 559384 on 2017/03/24 by user1@user1:main 'bug fix1'
Change 559178 on 2017/03/22 by branchowner@branchowner:ws 'Merge Integration@558992 to main '

      

We can see that in master this comes from a merge. And use annotation

$ p4 annotate -I //prod/main/platform/abc.txt
.
.
.
554294: Monday morning
554294: I love foot ball
554294: XNES rocks
.
.
.

      

we can say that the change comes from 554294

$ p4 describe 554294|more
Change 554294 by user2@user2:coorA on 2017/01/17 19:24:51
Integrate  all dev changes to coorA 

Affected files ...

.
.
.
... //prod/coorA/platform/abc.txt#1 add
.

      

554294 is a merge, and this merge adds the file abc.txt. But actually this abc.txt is not the original one created here. I created this abc.txt in my dev branch, but the guardian branch copied it from me and did a "p4 add" in my branch. So now for upstream, it can only see the file abc.txt, the original coming from the coorA branch. We have lost the real first owner for this file, we can only trace it.

what we want now is to get the original owner, but we lost touch when it is added to the coorA branch, is there a way to trace back deeper, for example with an md5sum file?

+3


source to share


2 answers


I am assuming you are looking at a change in a specific file. Find this file in P4V, right click and select Revision Graph. This will show you the propagation graph of the changes. Each node in the graph is one version of the file. Merges are shown as arrows (edges), so you will get 55445 to 53343 when raising errors.



Alternatively, to quickly see changes between different versions of a file, you can drag one node from the graph to another and P4V will show you a diff.

+1


source


As you say, change 55445 can include many changes from many different branches. You can view them all by running:

p4 changes -i @55445,55445

      

But when you say that you are trying to get the source of a more specific "change", I think what you are asking for is a special difference in change 55445, i.e. there is a specific line in a specific file that you are trying to find the origin. To do this, run:



p4 annotate -I //depot/file

      

The command p4 annotate

shows the changes / changes that each line has occurred within this file; the flag -I

tracks the merge relationship to find the true start point of each line in different branches.

Source: A blog post I wrote about this a few years ago. :) https://www.perforce.com/blog/101213/p4-annotate-i-going-deeper

+1


source







All Articles