Jump to content


In-place branch swapping with streams

streams in-place branching

  • Please log in to reply
2 replies to this topic

#1 SnakeNuts

SnakeNuts

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 28 February 2013 - 10:06 PM

Hi all,

Because of the way our current codebase works, I'm looking into using streams for in-place branch swapping. However, I've not yet had much success setting up a test server exactly the way I'd like it to work. I'm not an experienced P4 admin, but I'm looking in to this to see if we can actually do this (so be gentle with me if I am missing something rather obvious).

Basically we'd like to have a depot per product, where we have one main branch and several dev branches and probably several release branches as well. So far so like everything I've seen out there. Not the problem. What is a problem is then how I set up the server and/or people's workspace(s) to let them change what branch they're using with every single branch being in the same location. Every time someone switches to another of the dev or release (or main) branches, it should result in the same location on disk being populated with that branch's files.

If someone could take me through the steps or the commands in P4V, that'd be great.

Another consideration (seeing the size of the projects) is how this is then actually synced. I'm under the impression that there are some performance optimisations at work here, with only the files that are actually different between branches being downloaded from the server. Am I right in this?

Again, apologies if this is asking about something obvious, but in all the documentation for the streams functionality, I'm getting lost because I haven't really had enough time doing any real P4 admin work.

Cheers,

Alex.

#2 P4rdefauw

P4rdefauw

    Advanced Member

  • Members
  • PipPipPip
  • 69 posts

Posted 04 March 2013 - 12:00 AM

Hi,

View PostSnakeNuts, on 28 February 2013 - 10:06 PM, said:

Basically we'd like to have a depot per product, where we have one main branch and several dev branches and probably several release branches as well. So far so like everything I've seen out there. Not the problem. What is a problem is then how I set up the server and/or people's workspace(s) to let them change what branch they're using with every single branch being in the same location. Every time someone switches to another of the dev or release (or main) branches, it should result in the same location on disk being populated with that branch's files.

If someone could take me through the steps or the commands in P4V, that'd be great.

This should be pretty easy.  In P4V, just use the stream graph and drag the workspace icon from one stream to another.   There's a preference that says whether you want to reuse the same workspace or use a different workspace per stream; you want the former.

On the command line it's just "p4 client -s -S <stream name>".

View PostSnakeNuts, on 28 February 2013 - 10:06 PM, said:

Another consideration (seeing the size of the projects) is how this is then actually synced. I'm under the impression that there are some performance optimisations at work here, with only the files that are actually different between branches being downloaded from the server. Am I right in this?

Yes, the master server will do a checksum comparison and only send the files that are different between the branches. This isn't immediately apparent from the command line output but you'll notice the speed difference if you have a big workspace.

Cheers,
Randy

#3 SnakeNuts

SnakeNuts

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 04 March 2013 - 02:20 PM

Hi Randy,

That was exactly what I was looking for. To be honest the preference setting was the big thing. I was dreading this to be a more complex issue, but I completely missed the fact that what I wanted was explicitly in there.

Thanks!

Alex.





Also tagged with one or more of these keywords: streams, in-place, branching

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users