Perforce: view the changlist synchronized to the Workspace

Source: Internet
Author: User
Tags perforce

 

1. Check the changelist synchronized to the workspace.

Perforce's workspace is actually a combination of some specific versions of files. This method is more flexible than simply assigning the workspace to a specific changelist. The relationship between changelist and files is: Each changelist is actually a collection of files of certain versions, but not all versions of files correspond to a changelist. Perforce allows you to synchronize a workspace to a specific version of a file, not necessarily a chagnelist.

 

Use the following three steps to confirm the latest status of the workspace P4 changes command to view the highest chagnelist: P4 changes-M1 //... # Have

 

Run the following command to check whether all files in the workspace are synchronized to the top changelist: p4 sync-N @ <changelist retuned by P4 changes> If the preceding command shows that all files are already updated, the workspace is currently synced to the highest changelist.

 

At the same time, run the following command to ensure that no file is modified but not submitted: P4 opened

 

Note that the following depot syntax is equivalent: // <workspace Name> /... //... @ <workspace Name> //... # Have. Therefore, the command displayed in the official Knowledgebase of perforce is P4 changes-M1 //... @ <workspace Name>

 

Sometimes, if there are too many files, an error may occur. You can use the following method:

$ 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 pythonimport sys, OS, marshalif OS. name = "NT": # disable newline translation in windows. other operating systems do not # translate file contents. import msvcrt. setmode (sys. stdin. fileno (), OS. o_binary) lastcl = 0num = 0try: While 1: dict = marshal. load (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: lastcl = clexcept eoferror: passprint "files: % s" % numprint lastcl

Binary P4 cstat

Cstat -- dump change/Sync status for current client P4 cstat [files...] lists changes that are 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 'have ', 'need' or 'partial'

 

 

More use of P4 changes

P4 changes-M 5 // depot/project /... show the last five submitted changelists that 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 that include file file. c , as mapped to the depot through the client view, during the month of May 2000.
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 CMDL 1, 2001 to the present.
P4 changes @ 2001/04/01 Display All changelists submittedBefore10000l 1, 2000.

 

 

Refer:
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-perforcehttp://kb.perforce.com? Article = 51

Http://www.perforce.com/perforce/doc.current/manuals/cmdref/changes.html

 

 

Complete!

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.