Pergunta

I have shelved files a.txt, b.txt, c.txt.

Now I want to make some changes to a.txt and b.txt and shelve along with a new file d.txt

So,

  1. As First step unshelve the shelved a.txt, b.txt and c.txt by using p4 unshelve -s <changelist>
  2. Make changes to the a.txt, b.txt and c.txt
  3. Now what to ????? (Till here I am good, now what should be next step to shelve the a.txt ,b.txt, c.txt with changes along with d.txt)

Note: As after the step 2 , as a step 3,if I try to just give p4 shelve again , it just shows d.txt to shelve but not a.txt b.txt and c.txt.

Is there any easy way to do it?

Foi útil?

Solução

You should gotten a change number when you did the p4 shelve. If you can't remember it, p4 opened will tell you. You need to re-open d.txt and give it that change number using p4 reopen -c <change#> d.txt. Then run p4 shelve -r to update the shelved files.

Outras dicas

As others have noted in their answers, all of the files must be in the same changelist when you shelve them, so you'll need to reopen them into the correct changelist in order to update the original shelf.

I want to encourage you, though, to avoid the habit of updating shelves.

In my experience, it is almost always nicer to create a new shelf, and keep the old shelf around as the original "version" of your changes.

Shelves themselves aren't versioned, so when you update your shelf, you overwrite the previous copy of the shelf with the latest copy.

When you are making iterative changes, and capturing snapshots of them using shelves, it is very nice to create multiple shelves, one for each snapshot, so that you can go back and forth between the different approaches to your overall change.

After all, you might decide that you didn't want d.txt after all, and you want to get back to the approach that you had with just a.txt, b.txt, and c.txt.

If you've created two separate shelves, you can move back and forth between them to your heart's content.

Then, once you've finally decided (and submitted the shelf that you decided upon using 'submit -e'), you can discard the other shelves by running 'shelve -d -c NNN' and 'change -d NNN' and the server will entirely clean up all the resources used by those no-longer-wanted shelves.

Below picture will show it pictorially enter image description here

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top