一 查看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. selenium+python自动化80-文件下载(不弹询问框)【转载】

    转至博客:上海-悠悠 前言 上一篇是点弹出框上的按钮去保存文件,本篇介绍一种更加优雅的方法,加载Firefox和Chrome的配置文件,不弹出询问框后台下载. 一.FirefoxProfile 1.点 ...

  2. List转换为DataTable List<Entity>

    /// <summary> /// 将List转换成DataTable /// </summary> /// <typeparam name="T"& ...

  3. poj 1088(记忆化搜索)

    滑雪 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 88560   Accepted: 33212 Description ...

  4. [水煮 ASP.NET Web API2 方法论](1-8)添加 Session 状态

    问题 ASP.NET Web API 构建 Web 应用程序时,要求使用 Session 在服务器存储一些用户特定的信息 解决方案 ASP.NET Web API 不支持 Session,因为 API ...

  5. react native android 上传文件,Nodejs服务端获取上传的文件

    React Native端 使用react-native-image-picker 做出选择图片的操作,选择完成后,直接将图片Post至服务器,保存在服务器的某个地方(保存图片的路径需要公开显示),并 ...

  6. Ubuntu18.04 安装Chrome浏览器

    一路copy paste就OK sudo wget http://www.linuxidc.com/files/repo/google-chrome.list -P /etc/apt/sources. ...

  7. CodeForces 723E One-Way Reform

    构造. 有一种十分巧妙的方法可以使图中所有度数为偶数的节点,经过每条边定向后,出度和入度都相等. 首先统计每个节点的度数,将度数为奇数的节点与编号为$n+1$的节点连边,这样一来,这张新图变成了每个节 ...

  8. POJ 3662 Telephone Lines (分层图)

    Telephone Lines Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6785   Accepted: 2498 D ...

  9. 对有些反编译不成功的apk,请更新最新的apktool.jar、 dex2jar试试

    韩梦飞沙  韩亚飞  313134555@qq.com  yue31313  han_meng_fei_sha 对有些反编译不成功的apk,请更新最新的apktool.jar. dex2jar试试 a ...

  10. [TCO2013]DirectionBoard

    题意:给一个网格,每个格子有一个方向表示在这个格子上要往哪个方向走,你可以改变某些格子的方向,问最少多少次操作使得从任意格子出发都能回到这个格子 woc这都不会我还是回家种田去吧... 题目的要求是改 ...