[p4] Can you find out which changelist your workspace has been synced to?
Jeff A. Bowles
jab at pobox.com
Tue Jan 29 13:15:21 PST 2008
That's a very nifty way to do it. Thanks for the idea!
Also, I'll point out that "p4 fstat //myworkspace/..." is another
command to exploit. It is especially fruitful at times. (E.g., the
headache, "show files I need to open for add," becomes really easy if
you have this 'fstat' command in your arsenal.)
-Jeff Bowles
On Jan 29, 2008, at 8:07 AM, Bill Mauer wrote:
>
> Both of these posts point out why you may not be able to find a single
> changelist number. Steve's answer is the best as it gives you the two
> outside changelists. You can use that as a Boolean as to whether
> all of
> the files in the workspace are synced to the same changelist, which
> will
> then tell you the answer you are looking for:
>
> p4 changes -m 1 //myworkspace/... | awk '{print "//
> myworkspace/...@"$2}'
> | xargs p4 sync -n
>
> The above is all one line. If it says "file(s) up-to-date" after the
> changelist then you have your answer. If it tells you it would update
> files, then you have syncs to various changelists within the workspace
> and that should be corrected if you need an answer.
>
> Bill Mauer
> Lead Software Engineer
> Aspyr Media
>
> bmauer at aspyr.com
> 512-879-5936
>
> -----Original Message-----
> From: perforce-user-bounces at perforce.com
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of Stephen Vance
> Sent: Monday, January 28, 2008 5:31 PM
> To: Yamuna Ramasubramaniyan
> Cc: perforce-user at perforce.com
> Subject: Re: [p4] Can you find out which changelist your workspace has
> been synced to?
>
> p4 changes -m 1 //myworkspace/...
>
> will tell you the highest changelist number that had contributed to
> your
>
> workspace.
>
> p4 sync -n @12345
>
> will tell you whether everything up to and including that changelist
> that is mapped into your workspace has been synced.
>
> Ignoring the possibility that there are things in that changelist that
> aren't mapped to your workspace, these represent the necessary and
> sufficient conditions for your workspace being at that change level.
>
> Steve
>
> Yamuna Ramasubramaniyan wrote:
>> Hello,
>>
>>
>>
>> I'd like to find out what changelist my workspace has been synced to.
>> P4 sync -n shows me which files would be updated if I were to do a
> sync,
>> but I'd like to find out which changelist I last synced to. I recall
>> this could be done in svn. Is this possible in P4?
>>
>>
>>
>> TIA for your help,
>>
>> Yamuna
>>
>> _______________________________________________
>> perforce-user mailing list - perforce-user at perforce.com
>> http://maillist.perforce.com/mailman/listinfo/perforce-user
>>
>>
>
> --
> Stephen Vance
> www.vance.com
> _______________________________________________
> 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
More information about the perforce-user
mailing list