Jump to content


Listing files that have been edited after integration

perforce intergate

  • Please log in to reply
6 replies to this topic

#1 engr.vns

engr.vns

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 11 June 2020 - 05:52 AM

Suppose the user has "integrateD = (integrate+resolved)" files from a donor project.
The user has not yet submitted the files.
A selected set (non-trivial number) of integrated files were p4 edited and modified to meet receiver project requirements.

Is there a easy way to list out all files that were p4 edited in receiver project.

Right now, I am using a combination of sc opened piped into a sequence of grep commands ..

Looking for a simpler more robust solution to list locally modified post integrated files.

Thanks in advance

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 11 June 2020 - 01:56 PM

Why do you need a sequence of grep commands to figure out which files are open for edit or add?  It should only take one grep with an OR operator:

p4 opened | grep "edit\|add"

Or if you want to be resilient against files that have "edit" or "add" in their name you could do something slightly more clever, like:

p4 -F "%action% %depotFile%" opened | grep "^edit\|^add"

You can also use the filtering flags in "p4 fstat" if you wanted to avoid doing anything in external tools:

p4 fstat -Ro -F "action=add|action=edit" //...

and then combine that with the global -F flag to format the output into something less ugly:

p4 -F %depotFile% fstat -Ro -F "action=add|action=edit" //...


#3 engr.vns

engr.vns

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 11 June 2020 - 07:59 PM

Thanks Sambawise - You hit upon the issue there were files with "add" in the name which required to grep it out and was hence not a robust one...

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 11 June 2020 - 08:37 PM

View Postengr.vns, on 11 June 2020 - 07:59 PM, said:

Thanks Sambawise - You hit upon the issue there were files with "add" in the name which required to grep it out and was hence not a robust one...

Besides rewriting the message with `-F` to make it unambiguous, you can also grep on a larger subset of the message, e.g. " - add ", or even "#(\d)+ - add ".

#5 engr.vns

engr.vns

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 12 June 2020 - 06:37 PM

-----

#6 engr.vns

engr.vns

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 12 June 2020 - 07:27 PM

Another checkpoint for integration is what files were NOT updated (Not integrated/edited)

Is there a way to list these files which had no such action...

#7 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 12 June 2020 - 07:44 PM

Files with no open action at all would be:

p4 -F %depotFile% fstat -F "^action" ...





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users