[p4] Need to find most recent changelist for a given clientspec

alex.pavloff at l-3com.com alex.pavloff at l-3com.com
Wed Nov 12 12:57:27 PST 2008


Use:

p4 changes -m1 //depot/... at CLIENTNAME

Or, for the current client,

p4 changes -m1 //depot/...#have

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Shehadeh, Karim
Sent: Wednesday, November 12, 2008 10:35 AM
To: Rick Macdonald
Cc: perforce-user at perforce.com
Subject: Re: [p4] Need to find most recent changelist for a given
clientspec

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
use.

Thanks again,
Karim  

-----Original Message-----
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
clientspec

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 
something like:

$ 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.

Rick

Shehadeh, Karim wrote:
> Thanks for the quick reply.  Yeah, this is what I tried (minus the
'cut'
> command afterwards which is good to know, by the way, even though I'm
on
> 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.
Is
> it applying some other filter that I don't know about when a
clientspec
> 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
Macdonald
> 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
> clientspec
>
> $ p4 changes -c AUTOBUILD1 -m1 -s submitted | cut -d" " -f2
> 229399
>
> Rick
>
> 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
set
>> of files* is.  So, for example if I have a clientspec I've created
for
>> my build serve: AUTOBUILD1.  It contains a mapping that looks like
>>     
> this:
>   
>>  
>>
>> //depot/folder1/...
>>
>> //depot/folder3/...
>>
>>  
>>
>> So I want to get the most recent changelist for any files contained
>> within those two folders and irrespective of who submitted those
>> changes.
>>
>>  
>>
>> I know I can do something like this using p4 changes and passing in
>>     
> each
>   
>> 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
>>     
> this
>   
>> using the command-line tool only although I can parse the output.
>>
>>  
>>
>> Thanks,
>>
>> Karim
>>
>>  
>>
>>  
>>
>> _______________________________________________
>> perforce-user mailing list  -  perforce-user at perforce.com
>> http://maillist.perforce.com/mailman/listinfo/perforce-user
>>
>>   
>>     
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
>
________________________________________________________________________
__________________
> 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
e-mail. (1)
>
>   

_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user




More information about the perforce-user mailing list