Perforce查看workspace sync到的changlist



一 查看workspace sync到的changelist 



p4 changes 命令可以查看workspace中文件集合所对应的最高chagnelist:
p4 changes -m1 //...#have


p4 sync -n @<changelist retuned by p4 changes>


p4 opened


//<workspace name>/...
//...@<workspace name>
所以从perforce的官方的knowledgebase中看到的命令是p4 changes -m1 //...@<workspace name>



$ p4 changes -m1 "./...#have"  
Request too large (over 850000); see 'p4 help maxresults'.
$ p4 -G files "./...#have" | python c:/cygwin/usr/local/bin/ Files: 266948 2427657 

#! /usr/bin/env python
import sys, os, marshal
if == "nt":
    # Disable newline translation in Windows.  Other operating systems do not
    # translate file contents.
    import msvcrt
    msvcrt.setmode( sys.stdin.fileno(), os.O_BINARY )
lastcl = 0
num = 0
    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 = cl
except EOFError:
print "Files: %s" % num
print lastcl

二 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'



p4 changes的更多使用

Show the last five submitted changelists that include any file under the project directory
Show the last five submitted changelists from client workspace eds_elm.
Show the last five submitted changelists from user edk.
Show any changelists that include file file.c, as mapped to the depot through the client view, during the month of May 2000.
Output a single line showing the changelist number of the last submitted changelist.
Display all changelists submitted from April 1, 2001 to the present.







posted @ 2012-04-21 12:44  iTech  阅读(5023)  评论(0编辑  收藏