Create a new stream in the repository.
Namespace: Perforce.P4Assembly: p4api.net (in p4api.net.dll) Version: 2015.1.103.4687 (2015.1.103.4687)
Syntax
C# |
---|
public Stream CreateStream( Stream stream ) |
Visual Basic |
---|
Public Function CreateStream ( _ stream As Stream _ ) As Stream |
Visual C++ |
---|
public: Stream^ CreateStream( Stream^ stream ) |
Parameters
- stream
- Type: Perforce.P4..::..Stream
Stream specification for the new stream
Return Value
The Stream object if new stream was created, null if creation failed
Examples
To create a new locked release type stream in the repository, with ignored and remapped
paths:
CopyC#

Stream s = new Stream(); string targetId = "//Rocket/rel1"; s.Id = targetId; s.Type = StreamType.Release; s.Options = new StreamOptionEnum(StreamOption.Locked | StreamOption.NoToParent); s.Parent = new DepotPath("//Rocket/main"); s.Name = "Release1"; s.Paths = new ViewMap(); MapEntry p1 = new MapEntry(MapType.Import, new DepotPath("..."), null); s.Paths.Add(p1); MapEntry p2 = new MapEntry(MapType.Share, new DepotPath("core/gui/..."), null); s.Paths.Add(p2); s.OwnerName = "admin"; s.Description = "release stream for first release"; s.Ignored = new ViewMap(); MapEntry ig1 = new MapEntry(MapType.Include, new DepotPath(".tmp"), null); s.Ignored.Add(ig1); MapEntry ig2 = new MapEntry(MapType.Include, new DepotPath("/bmps/..."), null); s.Ignored.Add(ig2); MapEntry ig3 = new MapEntry(MapType.Include, new DepotPath("/test"), null); s.Ignored.Add(ig3); MapEntry ig4 = new MapEntry(MapType.Include, new DepotPath(".jpg"), null); s.Ignored.Add(ig4); s.Remapped = new ViewMap(); MapEntry re1 = new MapEntry(MapType.Include, new DepotPath("..."), new DepotPath("x/...")); s.Remapped.Add(re1); MapEntry re2 = new MapEntry(MapType.Include, new DepotPath("y/*"), new DepotPath("y/z/*")); s.Remapped.Add(re2); MapEntry re3 = new MapEntry(MapType.Include, new DepotPath("ab/..."), new DepotPath("a/...")); s.Remapped.Add(re3); Stream newStream = rep.CreateStream(s);