I am new to perforce streams. I have gone though some docs over net and not clearly understood what is the main use of perforce streams. Can any one please help me giving brief intro on perforce streams. what is the main purpose ? when it is useful ?
相关问题
- How to trigger a Jenkins build on a Perforce submi
- Perforce external diff in Eclipse?
- Customizing the output of Perforce RCS keyword exp
- List of checked out files by others in Perforce
- git p4 clone has no files
相关文章
- Perforce fast sync a directory to a clean state
- git-p4 submit fails with “Not a valid object name
- Unable to integrate fully from main branch to feat
- Find a string in Perforce file without syncing
- Value of using Git with ClearCase, AccuRev or Perf
- p4v does not show the complete list of checked out
- Integrating moved files in perforce
- How to fix Perforce error “Can't clobber writa
If you're already familiar with branching in Perforce, you're aware that a branch can be any arbitrary collection of files, managed by two types of view:
p4 integrate src... dst...
that's an ad hoc branch view.)The main purpose of streams from a technical standpoint is to eliminate the work of maintaining these views. With "classic" Perforce branching, you might declare the file path
//depot/main/...
is your mainline and//depot/rel1/...
is yourrel1
release branch, and then define views like this:If you wanted to have one workspace and switch between the two branches you'd do something like:
This is a very simple example of course -- if you decide you want to unmap some files from the branch, then you have to make that change in both client specs and possibly the branch view, if you create more branches that's more client specs and more branch specs, etc.
With streams the same simple two-branch setup is represented by two streams:
To do work in both streams you'd do:
All tasks around managing branch and client views are handled automatically -- the
switch
command generates a client view appropriate to the named stream and syncs it (it also shelves your work in progress, or optionally relocates it to the new stream similar to agit checkout
command), and themerge
command generates a branch view that maps between the current stream and the named source stream.More complex views are also handled; for example, if you want to ignore all
.o
files in all workspaces associated with either of these streams, just add this to the//depot/main
stream:This is automatically inherited by all child streams and is reflected in all automatically generated client and branch views (it's like adding a
-//depot/branch/....o //client/...
line to all your client views at once).There's a lot more that you can do with stream definitions but hopefully that gives you the general idea -- the point is to take all the work that people do to manage views associated with codelines and centralize/automate it for ease of use, as well as provide nice syntactic sugar like
p4 switch
andp4 merge --from
.It would be easier to answer this question if you gave some hint of your context -- do you already understand the general concepts of branching and merging as they're used in other tools, or better yet, are you already familiar with how branching works in Perforce without streams? If so I could give you some specifics on what the benefits of streams are relative to manually managing branch and client views.
For this answer though I'm going to assume you're new to branching in general and will simply direct you to the 2006 Google Tech Talk "The Flow of Change", which was given by Laura Wingerd, one of the chief architects of Perforce streams. This is from about 5 years before streams were actually implemented in Perforce (the 2011.1 release), but the core ideas around what it means to manage the flow of change between variants of software are all there. Hopefully with the additional context of the stream docs you've already read it'll be more clear why this is useful in the real world.
https://www.youtube.com/watch?v=AJ-CpGsCpM0