`

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.




分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics