一 查看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. False Positives和False Negative等含义

    True Positive (真正, TP)被模型预测为正的正样本: True Negative(真负 , TN)被模型预测为负的负样本 : False Positive (假正, FP)被模型预测为 ...

  2. hdu5782

    官方题解不是很详细 首先有一个结论:若A=pa+sa B=pb+sb A.B串循环同构,则可以构造一个可行方案(pa,sb) (sa,pb)中有一个是最长匹配,这个不难用反证法证明. 对于s1,s2串 ...

  3. 【剑指offer】面试题 9. 用两个栈实现队列

    面试题 9. 用两个栈实现队列 题目描述 题目:用两个栈来实现一个队列,完成队列的Push和Pop操作. 队列中的元素为int类型. 解答过程 import java.util.Stack; publ ...

  4. react native 问题点

    问题点一:安装了react-native-vector-icons后,编译出错 版本: "react": "16.2.0", "react-nativ ...

  5. ViewPager单页显示3个item

    原文地址:https://github.com/hongyangAndroid/MagicViewPager/wiki MagicViewPager 单页显示3个Item的ViewPager炫酷切换效 ...

  6. B. Black Square(字符串)

    B. Black Square time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

  7. [Luogu2540][NOIP2016]斗地主增强版(搜索+DP)

    增强版就是原版中两鬼不算对子的版本. 先爆搜出完所有对子,剩下的牌DP处理. 考虑每个数码的拆牌情况,最多可能被拆成5种情况:1+1+1+1,1+1+2,1+3,2+2,4.故DP状态数最多为5^13 ...

  8. [BZOJ 3326] 数数

    Link: BZOJ 3326 传送门 Solution: 明显是一道数位$dp$的题目,就是递推式复杂了点 先要求出一个数$\bar{n}$向添加一位后的$\bar{np}$的转化关系 令$res[ ...

  9. [ARC057D]全域木

    题意:求有多少个边权为$1\cdots\frac{n(n-1)}2$的完全图的最小生成树的边权为$a_{1\cdots n-1}$ 啊啊啊我tm真的是什么都不会啊 考虑kruskal的过程:每次选取跨 ...

  10. Problem D: 调用自定义函数search(int list[], int n),在数组中查找某个数

    AC代码#include <stdio.h> int find(int *a, int l, int x) { ; int i; ; i < l; i ++) if(a[i] == ...