Jump to content


Unshelve to different Stream

unshelve stream

  • Please log in to reply
5 replies to this topic

#1 SnakeNuts

SnakeNuts

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 19 July 2013 - 03:28 PM

Hi,

I'm looking at unshelving files that were shelved in one stream into another stream.

I've set up a test server (2013.1) and I'm using the latest version of both P4V and P4, so as far as I can tell, this should be able to work, however I must be missing something, as it's not.

First of all, I'm assuming this isn't possible in P4V (which is actually 2013.2 I just saw)? I can't find any way to get the -S parameter to appear in my attempts there.

However, I can't seem to get it to work on the command line either.

Here's my scenario: I've got a main branch and two dev branches (dev1 and dev2) and I've checked out, edited and shelved a file in dev2. Now I want this file in dev1.

I switch my workspace to dev1 and give the following command:

p4 unshelve -s [changelistno] -S //streams/dev1 //streams/dev2/[path]/[file]

But the reply I get is

//streams/dev2/[path]/[file] - file(s) not in client view.

I'm really unsure what I'm doing wrong here. The documentation says that -S should "...use[s] a generated branch view to map the shelved files between the specified stream and its parent stream.", but does this mean that the unshelving can only happen between parents and children, not peers?

Any help is - as usual - muchly appreciated.

Alex C.

#2 P4Sam

P4Sam

    Advanced Member

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

Posted 19 July 2013 - 10:16 PM

View PostSnakeNuts, on 19 July 2013 - 03:28 PM, said:

The documentation says that -S should "...use[s] a generated branch view to map the shelved files between the specified stream and its parent stream.", but does this mean that the unshelving can only happen between parents and children, not peers?

Correct, it's parent/child only -- the main use case for this is meant to be, say, starting a change in the mainline, realizing that it needs more stabilization (or otherwise is no longer compatible with your mainline's submit policy), and then moving it to your dev line.  

If you need to move a shelved change between more distantly related streams, you could:

a) create a regular branch view (using "p4 branch") that maps the shelf to wherever it's meant to go -- if files have been moved around, this gives you an opportunity to make sure they're all mapped appropriately.  ("p4 unshelve" doesn't line moved files up the same way "p4 merge" does.)
B) unshelve one hop, re-shelve, unshelve another hop...

#3 Tank

Tank

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 13 March 2014 - 11:52 AM

Sorry to bump this, but can you shed some light on what this voodoo is?  Simple case, I have...

Stable stream -> Main line -> Dev stream

To unshelve from dev to stable I have to do the following.

Switch working stream to main line
p4 unshelve -s cl# -S //DevStream
Switch working stream to stable
p4 unshelve -s ml_cl# -S //StableStream


The first p4 unshelve command makes sense I guess, but the second one doesn't, maybe this is because the stream view confuses the hierarchy and maybe I don't need the -S on the second p4 call as the CL is in the parent?

Can you clarify what is happening so my brain doesn't melt? :)

Cheers.

#4 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 13 March 2014 - 07:56 PM

I think you know this, but just to be clear for future people, the workflow is:

Switch working stream to main line
p4 unshelve -s cl# -S //DevStream
Shelve the files in //Dev/Main
Switch working stream to stable
p4 unshelve -s ml_cl# -S //StableStream

Here's what's happening:

1) Switch working stream to main line; p4 unshelve -s cl# -S //DevStream
This gets all of the files you care about into the mainline

2) Shelve the files in //Dev/Main
This creates a new shelf that child streams of the mainline can use

3) Switch working stream to stable; p4 unshelve -s ml_cl# -S //StableStream
This takes that shelf created in the mainline, and pulls the content into StableStream


The big thing to remember is streams are what I call "selfish islands". They only care about themselves and to some extent their direct relatives. StableStream and DevStream know nothing about each other, so to share content they have to do it through a mutual friend, which in this case is main.

At the end of the day 90% of what streams does for you is to generate the branch specs that tell Perforce how files are related and the workspace specs that tell Perforce what a user should have on their machine. If you find you do this operation a lot an easier way to do it is to create a branch spec in Perforce to explicitly describe where files in dev should go into stable and vice versa. Then you can use p4 unshelve -b shortcut_branch and do it in one shot.

#5 Tank

Tank

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 14 March 2014 - 09:50 AM

Yes, but in point 3) What relevance does specifying -S //StableStream in this case which is a stream we're already switched to, so itself in a roundabout way, that's the thing that confused me. As in point 1) you're specifying a different stream to yourself.  Is it because if it only has one parent or child it can be implied and doesn't actually need the -S switch, else if there are more it does?

#6 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 14 March 2014 - 04:37 PM

By specifying the stream you're letting Perforce know which relationship to use. Currently Perforce doesn't look at what stream your workspace is bound to at all; you have to tell it. Thankfully, P4Sam has been talking about making the shelving related commands smarter about using the bound stream when it makes sense.





Also tagged with one or more of these keywords: unshelve, stream

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users