One view workspace sync to Changelist
Perforce's workspace is actually a combination of some specific versions of the file, which is more flexible than just workspace correspondence to a particular changelist. The relationship between changelist and files is that each changelist is actually a collection of certain versions of a file, but not all versions of the file combination correspond to a changelist. Perforce allows users to synchronize workspace to certain specific versions of a file, not necessarily to a chagnelist.
Use the following three steps to determine the latest state of the workspace P4 changes command to view the highest CHAGNELIST:P4 changes-m1 for a collection of files in Workspace/... #have
You can use the following command to see if all the files in workspace have been sync to the highest changelist:p4 sync-n @<changelist retuned by P4 changes> If the above command shows that all files are already updated, it means that workspace is currently sync to the highest changelist.
Also use the following command to ensure that no files have been modified but not yet committed: P4 opened
Note that the following depot syntax is equivalent://<workspace name>/...//...@<workspace name>/... #have So the order from Perforce's official knowledgebase is P4 changes-m1//...@<workspace name>
Sometimes if there are too many files, there will be errors, you can use the following methods:
$ P4 changes-m1 "./... #have" Request too Large (over 850000); See ' P4 help Maxresults '. $ p4-g files "./... #have" | Python c:/cygwin/usr/local/bin/p4lastchange.py files:266948 2427657
p4lastchange.py
#! /usr/bin/env python import sys, OS, marshal if os.name = = "NT": # Disable newline translation in Window s. other operating systems does not # translate file contents. Import msvcrt msvcrt.setmode (Sys.stdin.fileno (), OS. o_binary) lastcl = 0 num = 0 Try: while 1: dict = MARSHAL.L Oad (sys.stdin) num = num + 1 for Key in Dict.keys (): # print "%s:%s"% (Key,dict[key ]) if key = = "Change": cl = int (Dict[key]) if cl > LASTCL: &NBSP;&NBSP;&NBSP;&NBSP;&Nbsp; LASTCL = cl except Eoferror: Pass print "Files:%s"% num print LASTCL
Two P4 Cstat
Cstat--Dump change/sync status for current client P4 cstat [files ...] Lists changes that is needed, had or partially synced in the current client. The output is returned in tagged format, similar to the Fstat command. The fields that Cstat displays are:change changelist number status ' has ', ' need ' or ' partial '
More use of P4 changes
Reference:
Http://p4t3.lollotec.com/2008/01/what-changelist-is-my-workspace-synced.html http://stackoverflow.com/questions /47007/determining-the-last-changelist-synced-to-in-perforce http://kb.perforce.com/?article=51/HTTP Www.perforce.com/perforce/doc.current/manuals/cmdref/changes.html
Finish.
Http://www.cnblogs.com/itech/archive/2012/04/21/2461262.html