[p4] Need to find most recent changelist for a given clientspec
Karim.Shehadeh at verint.com
Wed Nov 12 10:35:02 PST 2008
Thanks, Rick. As you mentioned that solution doesn't use the clientspec
which I need it to do (it has to do with the way we handle autobuild).
With help from you and others I believe I came upon a solution that
seems to work:
p4 set P4CLIENT=MY_CLIENT
p4 changes -m1 -s submitted //MY_CLIENT/...
The only way I could get the changes command to use an arbitrary
clientspec is to set the default on the machine to the one I planned to
From: Rick Macdonald [mailto:rickmacd at shaw.ca]
Sent: Wednesday, November 12, 2008 12:54 PM
To: Shehadeh, Karim
Cc: perforce-user at perforce.com
Subject: Re: [p4] Need to find most recent changelist for a given
You don't have to sync the files first. It should work. The following
will work as well, just as a test. It doesn't even use the clientspec:
$ p4 changes -m1 -s submitted //depot/folder1/... //depot/folder2/...
This may print more than one line of output, so on UNIX you would do
$ p4 changes -m1 -s submitted //depot/folder1/... //depot/folder2/... |
sort | tail -1 | cut -d" " -f2
The only way I could run it and get no output was to give it a depot
path that doesn't exist.
Shehadeh, Karim wrote:
> Thanks for the quick reply. Yeah, this is what I tried (minus the
> command afterwards which is good to know, by the way, even though I'm
> a Windows box). Nothing is returned, though. I'm positive that files
> within the clientspec's have been changed and yet they don't appear.
> it applying some other filter that I don't know about when a
> is used to return changes? Do you know if the client files have to be
> gotten prior to using this successfully or something?
> -----Original Message-----
> From: perforce-user-bounces at perforce.com
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of Rick
> Sent: Wednesday, November 12, 2008 10:55 AM
> To: Shehadeh, Karim
> Cc: perforce-user at perforce.com
> Subject: Re: [p4] Need to find most recent changelist for a given
> $ p4 changes -c AUTOBUILD1 -m1 -s submitted | cut -d" " -f2
> Shehadeh, Karim wrote:
>> What I would like to do is use the file mapping described in a
>> clientspec to deterimine what the most recent changelist *for that
>> of files* is. So, for example if I have a clientspec I've created
>> my build serve: AUTOBUILD1. It contains a mapping that looks like
>> So I want to get the most recent changelist for any files contained
>> within those two folders and irrespective of who submitted those
>> I know I can do something like this using p4 changes and passing in
>> folder path but what I really want to do is use a single command that
>> takes clientspec and spits out a changelist number.
>> Is this possible? I should add that I would like to be able to do
>> using the command-line tool only although I can parse the output.
>> perforce-user mailing list - perforce-user at perforce.com
> perforce-user mailing list - perforce-user at perforce.com
> This electronic message may contain proprietary and confidential
information of Verint Systems Inc., its affiliates and/or subsidiaries.
> The information is intended to be for the use of the individual(s) or
> entity(ies) named above. If you are not the intended recipient (or
authorized to receive this e-mail for the intended recipient), you may
not use, copy, disclose or distribute to anyone this message or any
information contained in this message. If you have received this
electronic message in error, please notify us by replying to this
More information about the perforce-user