Xavier T.
Xavier T.

Reputation: 42228

Renaming a stream

Due to some business reason, a product that was supposed to be called productB should now be called productA. It will be followed later by a productB.

To keep a semblance of sanity in our naming scheme, I'd like to rename the existing development stream to match the product name, so renaming productB to productA.

My questions are the following :

  1. If I rename the stream, by editing the stream name, will the underlying branch renamed as well (I somehow doubt it) ?

  2. What will happen to child stream ? Are they going to follow nicely the rename or are they going to be orphaned ?

  3. If I want to later (re)create a productB, isn't Perforce going to be totally lost between the old productBand the new productB?

I got the feeling this is not a well supported operation, and that maybe I should not do it. If this is doable, what is the safest way to do it ? Should I use p4 move as well ?

Upvotes: 3

Views: 3269

Answers (1)

Samwise
Samwise

Reputation: 71454

I'd personally avoid it since to the extent that anything references the old paths (not necessarily just in Perforce itself), those references are going to be invalidated when you rename everything.

That said, here's what you'd probably want to do:

  1. Create a new stream productA (using "p4 stream"), matching its Paths, Type, Parent, etc to productB.
  2. Duplicate the depot files from //depotname/productB into //depotname/productA (using "p4 duplicate").
  3. Obliterate the depot files from //depotname/productB (using "p4 obliterate").
  4. As best you can, locate references to productB (e.g. other streams parented from it) and change those to point to productA.
  5. Delete the now-empty productB stream (using "p4 stream -d").

Upvotes: 3

Related Questions