[p4] Can you find out which changelist your workspace has beensynced to?

Dave Lewis dlewis78731 at gmail.com
Tue Jan 29 10:54:16 PST 2008


interesting.  some time ago, when this command did not run so efficiently, I
used to do this by doing a p4 files //myworkspace/... and finding the
highest changenumber.  You need to check that you are using the right form
of the files command to get what you want.

best is to just sync to a known changelist number, and record that in a
file.

dave


On Jan 29, 2008 12:20 PM, Ed Mack <Ed.Mack at attachmate.com> wrote:

> >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.
>
> Another possibility is that the changelist to which your workspace is
> synced contains only deleted files (see Note 1 in Tech Note 51).  "p4
> changes -m 1 //myworkspace/..." will not include that tip, deleted-only
> changelist number, even though it affected your workspace (by deleting
> the files).  We had trouble with this case in our continuous-build
> application.  If the tip changelist contained only deletes, the app
> always thought our workspace was out of date, and it would build over
> and over until a new changelist was submitted that contained other
> actions.
>
> Ed
>
> -----Original Message-----
> From: perforce-user-bounces at perforce.com
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of Bill Mauer
> Sent: Tuesday, January 29, 2008 8:08 AM
> To: Stephen Vance; Yamuna Ramasubramaniyan
> Cc: perforce-user at perforce.com
> Subject: Re: [p4] Can you find out which changelist your workspace has
> beensynced to?
>
>
> 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
>
> _______________________________________________
> 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