Eddie on Games

Perforce Changelist Search

Posted on April 14th, 2009

Several months ago, I found myself in a situation where I wanted to search Perforce changelist descriptions. After exploring the UI, talking to coworkers, and asking the internet, I came to the conclusion that it simply wasn't possible using P4V or P4Win. There are ways to do this using the command line (run p4 changes and redirect the output to a text file, then use grep) or p4sql, but neither solution is simple and elegant. This turned out to be one of those little things that most people brush off but for some reason I couldn't forget about it. After all, if you're working with good, disciplined developers, the changelist description is usually the juiciest part of a commit. It should contain a brief description of the feature the developer added, the bug she fixed, or the content she changed. If you're like me, software annoyances such as this one occasionally turn into pet programming projects. After a month or two, this is what I ended up with:

(I recommend watching the HD version and exanding it to fullscreen so you can actually see what's going on. Turn up your volume for my voice-over.)

In short, the program allows you to sync all of the changes in a Perforce repository and search them locally. Just for fun, you can also view graphs of changes over time. I wrote it in Python, using wxPython for the user interface. Changes are stored in an sqlite database which makes searching fairly easy. The graphing is done using matplotlib and to bundle everything into a .exe I used py2exe. (Note: I wasn't able to cleanly pack the required matplotlib modules into the executable. If you have experience with this and can offer advice, please share.) Finally, to interface with Perforce I'm using P4Python. Although developers seem to have their fair share of complaints about P4V and P4Win, Perforce certainly does a great job of providing API's for several languages (C/C++, Perl, Python, Ruby). And from what I've heard, many companies use the API's to integrate their tools with perforce or add a layer on top of Perforce with custom behavior. However, it doesn't make sense for everyone to be writing the same custom tools (especially for things like version control). If Perforce were to add a good plugin architecture, that allowed you to insert features in the UI as first-class citizens, common tools could be written once and shared. This would especially help small and medium sized companies that might not have their own tools teams.

Update (5/8/09): Perforce Changelist Search 0.1 has been released.

7 Responses to 'Perforce Changelist Search'

Subscribe to comments with RSS or TrackBack to 'Perforce Changelist Search'.

  1. xqnstyl said, on April 15th, 2009 at 2:21 pm

    Great utility, Eddie! Will you contribute this to the Perforce Public Depot? I’m sure I and other P4 users could use a utility like this. Cheers!

  2. Eddie said, on April 18th, 2009 at 3:55 pm

    Thanks! I am planning to release the source soon. Not sure yet if I will put it in the Perforce Public Depot, on this site, or somewhere else.

  3. Perforce Search Tool « The Toolsmiths said, on April 20th, 2009 at 5:59 pm

    [...] Today, we have an interesting tool writen by Toolsmiths reader Eddie Schooltz.  The tool, which he wrote about on his blog, is for searching for Perforce change sets, and I can see how it would be incredibly useful [...]

  4. Free Wilzyx said, on April 22nd, 2009 at 1:00 pm

    Nice tool Eddie. It would definitely be useful for me. Do you have an ETA for releasing this?

  5. Eddie said, on April 22nd, 2009 at 10:33 pm

    Thanks, ETA is ~1-2 weeks. I’m in the process of working on several performance enhancements and cleaning up the code. Check back soon for an update!

  6. Nathan said, on April 28th, 2009 at 6:04 pm

    Yeah I can’t wait to get it! Hope it comes out soon, even if it is just the exe and no source. I am surprised they took searching out of P4V since it was in P4win. Glad to see someone coming out with a tool that is clean and does a good job of looking at history.

  7. [...] can now download and tryout Perforce Changelist Search for yourself. Be sure to check out the demo video if you haven’t already. Keep in mind that the initial sync may take a few minutes, depending on the [...]

Leave a Reply