一 查看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. hdu 4198:Quick out of the Harbour解题报告

    Quick out of the Harbour Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java ...

  2. 在网站中嵌入VideoJs视频播放器

    一个博客难免需要引用视频来说明内容,但想要自己来实现一个视频播放器是不是一时半会就能完成的,更重要的是这需要对视频播放技术有一定的了解.于是自然而然的有人会想到开源项目.一个不错的选择便是video. ...

  3. 如何实现electron多页面间通信

    如何实现electron多页面间通信 1,业务需求: 总共有两个页面,页面A显示数据,页面B处理数据,主线程Main 2,实现的技术方案: 在主线程中打开页面A和B,B页面不进行显示,主要负责处理从A ...

  4. Windows 10 安装 Mongodb

    因为新换了Windows 10 电脑,需要在新电脑重新安装所有的软件,包括mongodb 下载文件:首先在mongodb的官方网站上下载最新版本的mongodb安装程序,https://www.mon ...

  5. 【转载】TabLayout 源码解析

    原文地址:https://github.com/Aspsine/AndroidSdkSourceAnalysis/blob/master/article/TabLayout%E6%BA%90%E7%A ...

  6. ProgrammingProjectList-文本操作

    https://github.com/jobbole/ProgrammingProjectList 逆转字符串——输入一个字符串,将其逆转并输出. package com.zrl.github; im ...

  7. NBUT 1220 SPY

    $map$,简单模拟. #include<cstdio> #include<cstring> #include<cmath> #include<algorit ...

  8. python基础day4

    1.列表生成式,迭代器&生成器 列表生成式 将列表[0,1,2,3,4,5,6,7,8]中的每个值加1,如何实现?常用的几种方法 方法一: a=[0,1,2,3,4,5,6,7,8] for ...

  9. 3000大洋,自己配置i5主机

    自用的HP笔记本已经“七年之痒”了,所以在2016年新年之前,换了台新电脑.主要用来娱乐(电影),但是也要能够满足工作学习(本人从事IT行业)的需要. 遵循本人一贯的高冷装X的习惯,决定自己买配件攒机 ...

  10. JavaScript的程序构成

    JavaScript的程序构成主要从以下几方面做个总结:控制语句.函数 .事件驱动及事件处理,希望对读者有些帮助. 控制语句: if条件语句 基本格式 if(表述式) 语句段1: ...... els ...