Jump to content


mapping a workspace on disk to a folder inside a stream

streams workspace mapping

  • Please log in to reply
3 replies to this topic

#1 umair

umair

    Member

  • Members
  • PipPip
  • 19 posts

Posted 03 March 2015 - 10:44 AM

Hi.

I'm trying to add files/folders from my workspace to a new folder inside an existing stream.

I have lets say a workspace (called MyWork) rooted at:
/opt/projectA

Now projectA itself has lots of files and sub-folders and I have an existing stream , say workStream which also already has some files/folders in it.

To keep the stream clean and organized , I would like to add files from the workspace to a new folder in the stream.The folder doesnt exist yet.

Example:

//StreamDepot/workStream/folderForWorkStream/... MyWork/...

How can I do this? Any suggestions?

Thanks.
Umair

#2 umair

umair

    Member

  • Members
  • PipPip
  • 19 posts

Posted 06 March 2015 - 01:21 PM

Hi ,

I have a stream "StreamA"

It has the following folder structure (shown in full depot syntax):

StreamA
  (//StreamDepot/StreamA/modications)
  (//StreamDepot/StreamA/modications/toolA)
  (//StreamDepot/StreamA/modications/toolA/component1)
  (//StreamDepot/StreamA/modications/toolA/component2)

On my disk I have the path /opt/toolA which has the exact structure of the toolA folder in the stream. Im trying to create a mapping between the toolA folder on the stream and the one that resides on my disk (for versioning changes).

Something to this effect:

//StreamDepot/StreamA/modifications/toolA/... /opt/toolA/...

The constraint is that I cant change the folder structure on my disk to /opt/modifications to get this mapping:

//StreamDepot/StreamA/... /opt/modifications/... (that is I cant add this 'modications' folder on my disk that is in the stream).

Any Idea how this:

//StreamDepot/StreamA/modifications/toolA/... /opt/toolA/...

can be accomplished?

Thanks.
Umair

#3 P4Sam

P4Sam

    Advanced Member

  • Members
  • PipPipPip
  • 484 posts
  • LocationSan Francisco, CA

Posted 23 March 2015 - 06:59 PM

You should be able to accomplish this by creating a virtual stream that remaps toolA, like this:

Parent: //StreamDepot/StreamA

Type: virtual

Paths:
	exclude ...
	share modifications/toolA/...

Remapped:
	modifications/toolA/... toolA/...

Then create a client of that stream with "Root: /opt" and everything should map correctly.

#4 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 26 March 2015 - 12:00 AM

Hello Umair,

Yes, you can take files from projectA and add them to your stream as a sub-directory. See the example and reference below.

EXAMPLE

-- Switch to the stream client workspace
   (cannot submit from non-stream client)

$ p4 workspace -s -S //StreamDepot/workStream

-- To branch some from another depot location:
   [The '-v' flag prevents the sync of the target files. By default, p4 copy syncs the target files.
    If a large number of files is involved and you do not require the files to be present in your workspace,
    you can minimize overhead and network traffic by specifying -v.]

$ p4 copy -v //depot/projectA/... //StreamDepot/workStream/newfolder/...

$ p4 submit -d "Add files to the StreamDepot/workStream"

-- Then check and see that your new files are copied over to the stream directory

$ p4 dirs //StreamDepot/workStream/*

REFERENCE

See 'Streams Tutorial -> 3. Importing files into the mainline'

    http://answers.perfo...rticles/KB/3516





Also tagged with one or more of these keywords: streams, workspace, mapping

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users