Perforce View Workspace sync to Changlist

Source: Internet
Author: User
Tags perforce stdin

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

P4 changes-m 5//depot/project/ ... Show The last five submitted changelists this include any file under the project directory
P4 changes-m 5-c Eds_elm Show The last five submitted changelists from client workspace Eds_elm.
P4 changes-m 5-u EDK Show The last five submitted changelists from user EDK.
P4 changes file.c@2000/05/01,2000/06/01 Show Any changelists this include file file.c, as mapped to the depot through the client view, during the month of May .
P4 changes-m 1-s submitted Output a single line showing the changelist number of the last submitted changelist.
P4 changes @2001/04/01, @now Display all changelists submitted from April 1, 2001 to the present.
P4 changes @2001/04/01 Display all changelists submitted before April 1.

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.