一 查看workspace sync到的changelist

perforce的workspace其实是一些特定版本的文件的 结合,相比只将workspace对应到某个特定的changelist,此方法更灵活。changelist和文件间的关系为:每个 changelist其实是某些特定版本文件的集合,但是并不是所有的版本的文件结合都对应到一个changelist。perforce允许用户将 workspace同步到文件的某些特定版本,不一定对应一个chagnelist。

使用如下三步来确定workspace的最新状态
p4 changes 命令可以查看workspace中文件集合所对应的最高chagnelist:
p4 changes -m1 //...#have
可以使用如下命令查看workspace中是否所有的文件都被sync到了最高changelist:
p4 sync -n @<changelist retuned by p4 changes>
如果以上命令显示所有的文件都已经是updated,则表示workspace当前被sync到了最高changelist。
同时使用如下命令来确保没有文件被修改但是还没有提交:
p4 opened
注意如下的depot语法是等价的:
//<workspace name>/...
//...@<workspace name>
//...#have
所以从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/p4lastchange.py Files: 266948 2427657

p4lastchange.py

#! /usr/bin/env python
import sys, os, marshal
if os.name == "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
try:
    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:
    pass
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的更多使用

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 April 1, 2001 to the present.
p4 changes @2001/04/01
Display all changelists submitted before April 1, 2000.

参考:
http://p4t3.lollotec.com/2008/01/what-changelist-is-my-workspace-synced.html

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

Perforce查看workspace sync到的changlist的更多相关文章

  1. Perforce share workspace between linux and windows

    p4 workspace 跨平台共享 (linux 和 window 共享) 用来存放代码的目录: linux存放代码目录: /home/username/ windows 上map network ...

  2. eclipse每次闪退后都提示查看\workspace\.metadata\.log

    错误如下: 找到<workspace>/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi"文件,将其删掉,再重启 ...

  3. perforce 使用教程(zz)

    http://www.perforce.com/documentation/perforce_technical_documentation http://blog.csdn.net/brucexu1 ...

  4. [Perforce]password (P4PASSWD) invalid or unset. 的错误解决

    前言 使用 Perforce , 能够使用Perforce 的Client 端. 有时候在编写一些脚本或代码的时候, 可能或使用到 Perforce的命令的方式. 正常状况下. 使用例如以下命令: p ...

  5. perforce使用技巧

    如果用其他编辑器打开一个在perforce上的文件, 只需要在notepad++ (或者其他)上右键选择 然后到perforce的workspace里Ctrl + V 即可定位到该文件. 再使用Ctr ...

  6. oracle12C--DG FAR SYNC 部署(前提为搭建好12C的DG)

    <<往期12CDG搭建>> 一,理解同步异步模式 01, 使用LGWR 进程的SYNC 方式 1)Primary Database 产生的Redo 日志要同时写到日志文件和网络 ...

  7. Atitit 解决Unhandled event loop exception错误的办法

    Atitit 解决Unhandled event loop exception错误的办法 查看workspace/.metadata/.log org.eclipse.swt.SWTError: No ...

  8. Git本地仓库

    原文:http://www.cnblogs.com/wilber2013/p/4189920.html Git基本概念 在Git中,我们将需要进行版本控制的文件目录叫做一个仓库(repository) ...

  9. 第二章-如何使用github建立一个HelloWorld项目,git的add/commit/push/pull/fetch/clone等基本命令用法。--答题人:杨宇杰

    1.配置Git 首先在本地创建ssh 秘钥:在git bash输入: $ ssh-keygen -t rsa -C "your_email@youremail.com" eg:$ ...

随机推荐

  1. JAVA版数据库主键ID生成器

    import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; public clas ...

  2. AC日记——「SCOI2016」美味 LiBreOJ 2016

    #2016. 「SCOI2016」美味 思路: 主席树: 代码: #include <bits/stdc++.h> using namespace std; #define maxa 26 ...

  3. netcore 配置文件使用

    一直在记录整理接口调用,但是最近发现关于项目在vs中本地启动也有许多方便的地方. 首先由于使用的是Java的Eureka和网关来做的服务基础, 然后服务就涉及到注册一说, 问题是,如果appsetti ...

  4. Docker 常用命令收集

    查看Docker版本 docker version 查看 Image docker images 打包 Image docker save -o ‘packageName.tar’ ‘imageNam ...

  5. flex布局各种情况总结分析及实例演示

    2009年,W3C提出了一种新的方案----Flex布局,可以简便.完整.响应式地实现各种页面布局.目前,它已经得到了所有浏览器的支持,这意味着,现在就能很安全地使用这项功能. 通过笔者大量实践,发现 ...

  6. sublime text按esc经常进入command mode(不能输入任何东西)

    在使用sublime text进行 选中 操作中,如果使用了esc退出选中状态,会进入command mode,现象是不能输入任何东西,关闭当前编辑文件重新打开可以解决.但是很影响连贯性.可以通过一些 ...

  7. spring boot 使用thymeleaf模版 报错:org.thymeleaf.exceptions.TemplateInputException

    错误: org.thymeleaf.exceptions.TemplateInputException: Error resolving template "Hello", tem ...

  8. Exception异常处理机制

    为什么要自定义自己的Exception ,Java Exception机制与传统的C语言的异常处理机制有什么不同,这种Exception机制的意义在什么地方?接下来咱就来和你一起探讨Exception ...

  9. Django CRM查询 XXX.object.filter() 常用用法总结

    __gt 大于 __gte 大于等于 User.objects.filter(age__gt=10) // 查询年龄大于10岁的用户 User.objects.filter(age__gte=10) ...

  10. POJ3468 A Simple Problem with Interger [树状数组,差分]

    题目传送门 A Simple Problem with Integers Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 1 ...