un-CharlieH
un-CharlieH

Reputation: 127

How to ask perforce for a list of changes with both description and files

I want to get a list of changes for a perforce branch like:

p4 -t -L //mydepot/library1/v1.0/...@2017/03/27,@now

That is, a list of all changes this week with description. But I also want a list of the files, as in files in one changelist:

p4 files @=123456

This seems like it needs script, but anyone know of a perforce method? If the returned changeset collection is large, will the server be adversely impacted by querying every changeset afterwards?

Upvotes: 0

Views: 87

Answers (2)

Samwise
Samwise

Reputation: 71454

p4 -Ztag -F "describe -s %change%" changes //mydepot/library1/v1.0/...@2017/03/27,@now | p4 -x - run

The answer to the performance question depends on how many is "large" (how many changes/files are we talking about) and your server hardware.

My guess is that with a "normal" server and "normal" usage you'll be fine but if we're talking about a few billion changes with a few billion files each, yeah, those commands will take a while. If we're more in the hundreds or thousands range, meh.

Upvotes: 1

Bryan Pendleton
Bryan Pendleton

Reputation: 16359

You asked a bunch of questions in one question, so here's a bunch of answers in one answer.

  1. Use the p4 changes command to get a list of changes of interest.
  2. Use p4 describe -s or p4 files @= to get a list of the files in each change.
  3. Yes, to combine these two sets of data you need a script, but it can be a remarkably short script. You can use the p4 command-line aliases feature to write such a script, or you can use your favorite scripting language. There are lots of examples of such scripts on the web.
  4. The server will end up have to perform multiple commands, but these particular commands are ones that the server does very efficiently. I suspect that it won't be so much that the server will have a problem computing the output, but that you will have a problem reading all that output. In other words, don't run a script that produces more output than you want to read.

Upvotes: 0

Related Questions