Chapter 1. Files in the Depot

P4 Command-line client is more formidable than GUI.
Filespec is the syntax which is to refer to workspace and depot contents.

A filespec uses "//" to indicate the root of the hierarchy, and "/" as a directory path and file name separator. //depot/projectA/doc/index.html

there can be multiple depots in a Perforce repository. The filespec root identifies the name of the depot. The filespec //depot/projectA/doc/index.html refers to a depot named "depot"

Either you can use absolute path, or relative path(depends on your current directory)

a filespec like projectA/d*/*.html, for example, can define a collection of files like:
projectA/dev/index.html
projectA/doc/diagnostics.html
projectA/doc/index.html
projectA/... refers to the files in the projectA directory
A filespec is a kind of view. A lot of views are stored in Perforce.
-----------------------------------------------------------------------------------------------------------------
A important example!!---show change history.
The view notion in P4 is very important! Especially the notion of interaction of views elaborated in this example
the P4 command that shows the history of changes to HTML files in the //depot path:
p4 changes //depot/.../*.html

Change 1386 on 2005/06/10 ... 'New page for promo...'

Change 1375 on 2005/06/05 ... 'Fix links on sign-up...'

Change 1369 on 2005/05/29 ... 'Add press releases...'
This command is affected by two views. The first is the filespec you see on the command line. The second is a view you don't see: the set of depot files you have permission to access. If, for instance, the access permission view is:
//depot/projectA/...
//depot/projectB/...

the net effect is that you will see the history of the files in the intersection of the two views. In other words, you will see the history of the set of files defined by this view:

//depot/projectA/.../*.html

//depot/projectB/.../*.html
-----------------------------------------------------------------------------------------------------------------

A important example!!---get a specific version(by version number) of some file---using #VersionNumber
index.html#10

A important example!!---get a specific version(by date) of some file---using @changeDate
index.html@2004/11/21

A important example!!---get a specific version(by date) of a bunch of files---using @changeDate
//depot/projectA/...@2004/11/21

A important example!!---the latest files in doc directory
doc/...#head

A important example!!---the files changed on 2004/01/04 in doc directory
doc/...@2004/01/04
the date 2004/11/21 is actually shorthand for 2004/11/21:00:00:00.
It refers to the latest revision of the file as of the commencement of November 21, 2004.

A important example!!---the files with the tag Good2Go in doc directory
doc/...@Good2Go

What’s a changelist. Changelist notion is also very important!!!
Perforce uses changelists to track changes submitted to the depot.

A important example!!---Actually, a little bit confused. The head branch? Or my understanding, it’s just retrieve files using changelist number.
doc/...@3405
Chagelist seems like tag in CVS, just a time slice of a CVS state.
Changelists represent points in time at which users submitted files. every changelist number is associated with a unique state of the collection.
This diagram is very important!! Changelist means the same of notion time.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值