Search code examples
perforceperforce-client-spec

Perforce: Any way to run 'p4 changes' without a clientspec?


I know that generally, when running p4 changes you need a clientspec specified, so that Perforce can limit the results properly.

Yet, in P4V, you are allowed to operate in a "no workspace selected" mode, and you can view changes, etc.

I want to do something similar from a script, but the only way I can think to accomplish this is to:

  1. Create a temporary clientspec, with some general //depot/... mapping
  2. Perform my operations (eg: p4 changes blabla)
  3. Delete the temporary clientspec

But I don't want to have all these temporary clientspecs being created/destroyed all the time. P4V doesn't seem to be doing that in its "no workspace selected" mode.

Is there a way to acomplish the same, from the commandline?


Solution

  • Your client spec doesn't matter at all if you provide a depot path to the "p4 changes" command. Just run:

    p4 changes //depot/...
    

    or whatever command you were going to run with your temporary "//depot/..." mapped client spec.

    Your client spec will ONLY come into play if you use an argument that is explicitly client-relative, such as a local file path, the #have revision specifier, et cetera. If you don't use a client-relative argument, it doesn't matter if your clientspec is undefined, if it maps only one file, or if it maps the whole world, you'll get the same results from "p4 changes" regardless.