1

I am trying to extract diff between to perforce revision files. But my requirement is to extract function names which got modified. Is there a way to find changed functions.

Mahesh Karia
  • 2,045
  • 1
  • 12
  • 23
  • Afaik perforce can't do that for you. Fetch both versions and diff them should work though. – fredrik Dec 20 '17 at 06:03
  • You may have to actually "parse" (I use the term relatively loosely) the source file to do that. Get the whole source file, scan backwards from the diff-point until you find the function declaration. Coding style will probably help you here, so you may be able to identify a function from "it's starting at column 1 and has parenthesis", for example. – Mats Petersson Dec 20 '17 at 07:21
  • @Mats Petersson, Thank you. By the above way I am able to parse and extract Function changed. – Abhishek Bajaj Jan 19 '18 at 09:45

1 Answers1

0

Do p4 diff2 and grep with a regex that matches function names:

Regex to pull out C function prototype declarations?

Samwise
  • 68,105
  • 3
  • 30
  • 44