How to search for change lists text in Perforce?

Sometimes I find text for change lists in Perforce. There is no way to do this in P4V. I can do this by redirecting the output of the changes command to a file ...

p4 changes -l > p4changes.txt 

... (the -l switch indicates that it unloads the full text of the change list descriptions) and then looked for the file, but this is rather cumbersome. Has anyone found a better way?

+60
perforce
Sep 25 '08 at 15:44
source share
8 answers

When focus is displayed on the panel with the changes made, CTRL + F allows you to perform an arbitrary text search, which includes descriptions of change lists.

The only limitation is that it only searches for change lists that have been received from the server, so you may need to restore the number. This is done using the parameter "Number of change lists, tasks, branch mappings or labels for selection at a time", which can be found by clicking on the link "Edit-> Settings-> Server data".

+55
Dec 01 '08 at 22:26
source share

I use p4sql and run a query in the "changes" database. Here is the database schema binding

The query looks something like this (untested)

 select change from changes where description like '%text%' and p4options = 'longdesc' 

edit: added p4options to return more than 31 characters in the description.

+17
Sep 25 '08 at 15:57
source share

p4 changes -L | grep -B 3 searchstring

-B 3 means show 3 lines before the matching line, should be enough to show the change identifier with two line comments, but you can change it as needed.

+15
Oct. 15 '09 at 11:54
source share

Here is the Powershell version of Paul's answer "grep". Again, it searches for the specified line in the description of the change and returns 3 lines in front of it to include the identifier of the change:

 p4 changes -L | select-string "search string" -Context (3,0) 
+6
Oct 07 '10 at 11:13
source share

Why redirect the file if you can pass the output through less and use less search?

 p4 changes -l | less 

And then press / to bring up the search bar. After that, n goes to the next match, and Shift + n goes to the previous one.

A less implementation for Windows is available as part of UnxUtils .

+2
Sep 15 '12 at 23:55
source share

Using p4sql is really the only way to effectively do what you want. I do not know another way. Of course, you can use select statements to limit the range of change lists (by date, user, etc.). Your method will work, but it will be very cumbersome as you create more change lists. You can limit the scope of the change command, but you won’t get the flexibility of p4sql.

+1
Sep 25 '08 at 17:16
source share

Eddie at Games published his Perforce Changelist Search 0.1 at http://www.eddiescholtz.com/blog/archives/130

But I like to use my favorite text editor with a simple one: p4 changes -s submit // prog / stuff / main / ...> temp.txt

+1
Jun 24 '09 at 19:45
source share

If you still love your command line, you can write a small perl script that:

  • changes the record separator $ / to double newline "\ n \ n", so it filters input to full ztagged p4 records.
  • scans part of '/ ^ ... desc /..//' with regular expressions from args.

usage will be something like 'p4 -ztag changes -l | yourperlfilter.pl searchterm1 searchterm2'

if this worked fine, you can integrate it into the p4win tool menu .

0
Nov 21 '08 at 6:47
source share



All Articles