ARPIT AGARWAL
ARPIT AGARWAL

Reputation: 43

Given the Function Name, how to find the Changelist in perforce when that function was added?

I am looking for a way to find the changelist in perforce if I have the Function name and File in which that function is present ? For Eg: if "A.cpp" has function added "void b()" via changelist 1234

I would like to get back changelist 1234 by giving the Function name only or both function name and file name. I was thinking to use python script for this but not sure how to proceed.

Upvotes: 2

Views: 102

Answers (1)

Samwise
Samwise

Reputation: 71562

Use p4 annotate, e.g.:

p4 annotate -c A.cpp | grep "void b()"

Check out p4 help annotate for the options available -- you can use the -I flag to find the origin changelist if the line was added by a merge, you can use the -a flag to find text in earlier versions of the file, etc.

Upvotes: 1

Related Questions