Jump to content


Multiple Workspaces


  • Please log in to reply
27 replies to this topic

#1 GeorgeH

GeorgeH

    Member

  • Members
  • PipPip
  • 13 posts

Posted 16 July 2019 - 04:05 PM

Hi there.

I've very recently installed Helix and P4V to use along side UE4 as my main source control.

For some odd reason, I cannot work out how I add multiple workspaces. When setting up P4V, I have managed to add in a workspace which links to UE4 fine and vice versa. However, when I'm trying to create a new Workspace, I am not getting the 'Add Files to Server' window, which appeared when setting up the first workspace.

Any ideas?

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 947 posts

Posted 17 July 2019 - 03:42 AM

Once you've created a new workspace, you can just put files in it and add them like normal, regardless of whether the "add files to server" wizard pops up.  Or you can sync down a fresh copy of existing depot files and work on those, or do anything else you can do with your first workspace.

I expect you only get that wizard as part of your first-time setup since it's assumed that you haven't added anything to the depot yet.

#3 GeorgeH

GeorgeH

    Member

  • Members
  • PipPip
  • 13 posts

Posted 18 July 2019 - 06:44 PM

Okay that makes sense.

The thing that is confusing me is that, when I try to add another workspace for a new project, I don't get how I'm meant to link that workspace to a UE4 project.
If I want the projects workspaces to be complete separate, do I create a new Depot for each project?

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 947 posts

Posted 18 July 2019 - 07:08 PM

Each workspace should have a unique "client root", which is the directory on your local disk where the files live.  That's what separates the workspaces and makes it so that what you do in one doesn't overwrite what you're doing in the other in any unsafe way, even if both workspaces are viewing the same depot location, as defined by the "client view".  (When you submit from one workspace and sync another, Perforce handles the task of making sure that everything is merged in a safe, orderly, and well-tracked way.)

It's completely up to you whether you have your projects in different depots, or different directories within a depot.  It's also up to you whether you have one workspace per project or multiple workspaces per project.  It's also up to you whether you have multiple projects in a single workspace or if each workspace is scoped to a single project.

If the real question you're asking is "how do I make a new project," you don't need to make a new workspace for that.  Just figure out where the new project will live in the depot (this might mean creating another depot, or it might mean just creating a new folder; this is, again, completely up to you), put it in the corresponding location in your workspace, and add it.  Done!  (Or make a new workspace if you want -- this is all down to personal preference.)

#5 GeorgeH

GeorgeH

    Member

  • Members
  • PipPip
  • 13 posts

Posted 18 July 2019 - 07:33 PM

Ideally, I'd prefer a depot for each project to help keep them separated and easier for me to keep track of things.
I've managed to create a new mainstream depot (I believe), and it seems to have duplicated my existing project. I've been trying to delete this, but I cannot seem to get command line to connect to the server. Or even trying to create a new depot though command line I get this error:

I always get this error with any p4 command
Perforce client error:
   Connect to server failed; check $P4PORT.
   TCP Connect to SERVER_NAME:1666 failed.
   No such host is known.


#6 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 947 posts

Posted 18 July 2019 - 08:37 PM

Quote

I've managed to create a new mainstream depot (I believe), and it seems to have duplicated my existing project.

This does not sound right (a new depot should be empty), and also a "mainstream depot" is not a thing, so I'm not sure what it was you created.  (Was it a new stream depot?  A mainline stream?  A new local depot?  A new server instance?  None of these things should have ended up with a duplicate of your existing project in them.)

Quote

Perforce client error:
   Connect to server failed; check $P4PORT.
   TCP Connect to SERVER_NAME:1666 failed.
   No such host is known.


Do:

p4 set P4PORT=your_perforce_server:1666

where your_perforce_server is your actual Perforce server.  (You should see it in P4V's title bar -- if the port isn't 1666, change that too.)

You might also need to do:

p4 set P4USER=your_user_name
p4 set P4CLIENT=your_workspace_name


#7 GeorgeH

GeorgeH

    Member

  • Members
  • PipPip
  • 13 posts

Posted 19 July 2019 - 08:41 AM

Okay, fantastic! Thanks for that! I can connect now using command-line commands.

When I mentioned about a project being duplicated, this is how my Depot looks in P4V:

depot
streamsDepot
	 mainline (mainline)
		  Project1
	 Project2
		  Project1
I did try to make another depot for a new project, but it just seems to have taken the path for my existing project rather than duplicate it. As for this 'depot' or 'streamDepot' with Project2, I haven't been able to remove it from P4V. I've been searching around to try to understand how to use P4V, but it seems confusing in certain places.

With the 'p4 info' command, my Client Name returns it's name, but with (illegal) after the name. Before this was set to my port, which I've changed, but it's still saying illegal.

#8 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 947 posts

Posted 19 July 2019 - 02:36 PM

Aha!  So what you did was create a branch of your mainline stream.  A new branch is NOT a new project, it's a new VERSION of the original branch!  That's why you now have two versions of Project1, which is probably not what you want.

Since you're using stream depots with a depth of 1, what you probably want to do is define your new project as a new stream depot, so that it can have its own branches that are independent of whatever you're doing in Project1.  From the command line you'd do this by running:

	p4 depot -t stream Project2
	p4 stream -t mainline //Project2/main

Now you can do:

p4 switch //Project2/main

to switch your current workspace over to the mainline of your new Project2 depot.  Whatever you add to your workspace and submit will go into that stream.

If you want to create a new workspace for use with the new stream/depot instead of swapping out the contents of your current workspace, that's simply:

cd c:\local\path\to\project2
p4 set P4CLIENT=my_project2_workspace
p4 client -S //Project2/main

In either case, ignoring the "Project2" branch that you've already created, what you should end up with on the depot side is:

depot
streamsDepot
	mainline
		Project1
Project2
	main


#9 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 947 posts

Posted 19 July 2019 - 02:42 PM

Leaving the previous post up for posterity, but I just realized that there's a good chance you don't actually care about branching these projects independently.  If that's the case, there's a much simpler solution, which is just to put Project2 in a folder next to Project1:

depot
streamsDepot
        mainline
                
Project1
                Project2


This doesn't require you to do anything at all other than simply putting the Project2 files in a folder that's in the right location within your current workspace, and then adding them to the depot.

#10 GeorgeH

GeorgeH

    Member

  • Members
  • PipPip
  • 13 posts

Posted 22 July 2019 - 03:48 PM

I have been playing around with P4V and P4Admin these past few days and seem to be getting 'somewhere', but I'm getting confused on how I add a project to a depot, and then create a workspace for it. I'm hosting the server locally on my PC, so I'm not sure if that's causing any conflicts. And I'm also using the free version, which I'm not sure as well if that's causing issues or not.

Ideally, I'd be happy with the two following set up of projects

Have one depot, with each of my UE4 Projects under that one depot
UE4_Projects
Project1
Project2

Or, have 1 depot for each projects
Game1
Project_Files
Game2
Project_Files


#11 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 947 posts

Posted 23 July 2019 - 07:06 AM

Here

View PostGeorgeH, on 22 July 2019 - 03:48 PM, said:

I'm getting confused on how I add a project to a depot, and then create a workspace for it.

You're confused because you're trying to do things in reverse order.  :)  The workspace is what you use to add the files, so you can't add any files before you create a workspace.

I gave some examples in my previous posts of different ways you could do this.  Let me know which part isn't working and I can help you troubleshoot!

#12 GeorgeH

GeorgeH

    Member

  • Members
  • PipPip
  • 13 posts

Posted 23 July 2019 - 04:06 PM

I wrote down the steps I do to get one UE4 Project working, but I cannot seem to re-create these steps.

P4V - Creating a Depot, Streamline and Mainline

- Open P4Admin
   - File > New > Depot
   - Depot Type > Stream (a local depot that stores stream files)
- OK.

- Open P4V
   - Select the depot previously made
   - File > New > Stream
	  - Name the Stream
	  - Stream Type > mainline
	  - Depot: Name of previously made depot in P4Admin (Auto populated)
	  - Location: //DEPOT_NAME/ (auto populated)
	  - Description: Depot Created By USER.
	  - Create a Workspace to use with this stream [TICKED]
	  - Populate the mainline stream after it is created [TICKED]
   - OK.
   - Helix P4V Pop-up Window
	  'The stream "mainline" is empty.
	  'Choose one of the options below to populate the stream:'
	  - Copy Files from the local file system (Chose this one)
	  - Branch Files from the server's depot
		 - Add Files Wizard
		 - mainline (//DEPOT_NAME/mainline)
		 - Browse to where the UE4 Project is located on my PC
		 - Next
- Finish


#13 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 947 posts

Posted 23 July 2019 - 07:19 PM

I'm not very familiar with P4V, but that looks about right.  At what point does that fail?  Based on your earlier posts it didn't look like you had gotten as far as creating a new depot.

#14 GeorgeH

GeorgeH

    Member

  • Members
  • PipPip
  • 13 posts

Posted 24 July 2019 - 01:31 PM

It's trying to recreate them steps to make another depot for a new project where is doesn't show the 'Add Files Wizard' to add the UE4 project into it.

#15 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 947 posts

Posted 24 July 2019 - 02:41 PM

Based on the output from your earlier example, these were not the steps you were following, because there's no new depot created, and the new stream was under your previously existing depot rather than a new depot.  Maybe that's the source of the problem?

Specifically this part:

- Open P4Admin
  
- File > New > Depot
   - Depot Type > Stream (a local depot that stores stream files)
- OK.

After you do this, you should have a new stream depot with a new name (it should show up in the depot view as "//project2" or whatever at the very top of the tree.  What went wrong there?

#16 GeorgeH

GeorgeH

    Member

  • Members
  • PipPip
  • 13 posts

Posted 24 July 2019 - 04:31 PM

I've been playing around with P4V some more, and I've managed this.

I've got all of my current UE4 Projects in a Stream Depot/Workspace, and each project can connect to it perfectly. However, I'm now wondering how I could essentially have each project on a different workspace, rather than the same one?

Two screen grabs of my current P4V layout have been attached to this reply to give you a better understanding. :)

Attached Thumbnails

  • Capture.jpg
  • Capture2.jpg


#17 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 947 posts

Posted 24 July 2019 - 04:54 PM

View PostGeorgeH, on 24 July 2019 - 04:31 PM, said:

I've got all of my current UE4 Projects in a Stream Depot/Workspace, and each project can connect to it perfectly. However, I'm now wondering how I could essentially have each project on a different workspace, rather than the same one?

Since you have them all in one stream, they're always going to be in the same workspace, since each workspace maps a particular stream (as a whole) rather than an arbitrary depot path.  ("Classic" clients associated with a local depot have manually configurable views that map arbitrary depot paths to arbitrary client paths.)

The way to have your projects all in different workspaces (and their own set of stream variants, i.e. the ability to create development streams off of each mainline) would be to put them in different stream depots with their own mainlines, which is the process that you described (but didn't do).  :)

(Note before some pedant pokes their head in: you could create virtual streams off your mainline to make it possible to have one workspace per folder while keeping everything in one concrete mainline stream.  I'm not going to recommend that here because it's going to require an order of magnitude more explanation than simply creating a new depot.)

#18 GeorgeH

GeorgeH

    Member

  • Members
  • PipPip
  • 13 posts

Posted 24 July 2019 - 06:42 PM

This is starting to make more sense now.

This is the bit that's confusing me...
I've created a depot, added a stream and workspace etc, and this links to UE4 perfectly. All pushes, initial commits etc are showing in the history of P4V - all fine and working.

Now, when I try to recreate the steps, I get the following (screen grab attached).

This is what I was trying to say above, I don't think I explained myself properly, so I appologise for that. I've added into the screen grab more details about what I'm confused about.

Attached Thumbnails

  • Capture.PNG


#19 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 947 posts

Posted 24 July 2019 - 07:05 PM

Okay -- so from the command line, you'd just do:

p4 stream //TestProject/main

and you'd be set to go (it'd automatically set the stream up with reasonable defaults).  Presumably this dialog will run that command for you and it's just a matter of figuring out where to paste in that information to get it to run that command.

Can you just enter "//TestProject/main" for "stream name" and set the type to be "mainline"?

Disclaimer: I have no idea what "Location" is supposed to be because P4V always makes everything more complicated.  Maybe "Location" is "//TestProject" and "name" is "main"?  Maybe you get some of these fields filled in if you select "//TestProject" before you click "New stream"?

#20 GeorgeH

GeorgeH

    Member

  • Members
  • PipPip
  • 13 posts

Posted 24 July 2019 - 07:28 PM

I've just spotted where I was going wrong, after 2 weeks of trying to figure this out.

With the screen grab I sent in my previous post, I noticed the 'Stream Type' was set to development, which for some reason wasn't picking up on the streams I had made.
I've changed that to 'mainline' instead of 'development', and I can have different depots and each one tied to it's individual workspace. Not sure if this is good practice or not, but it seems to be working fine! :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users