Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perforce - How to remove a file from a shelved changelist?

I had added a bunch of new files into a new changelist using p4 add command. I shelved the changelist for review purpose (swarm server picks the changes from shelved changelist).

During code review, I was told to remove a file from the changelist. I did the following steps to achieve the same

  1. First, unshelve the changelist

    p4 unshelve -c (cl-number)

  2. Reverted the file that I had added previously

    p4 revert (file)

Perforce says "....../file - was add, abandoned"

  1. Again, shelve the files back

    p4 shelve -f -c (cl-number)

Now, if I see p4 change (cl-number), the file that I deleted is not visible in the files mentioned below. However, if I do p4 describe -s -S (cl-number), the removed file is still visible and not being removed from shelve.

What should be done to remove a specific file in a shelved changelist?

like image 757
Sathya Avatar asked Apr 27 '17 06:04

Sathya


People also ask

How do I delete a file from Changelist?

You can Ctrl+left-click multiple files, then right-click on one of them and select Move to another changelist... . You can also choose to Submit... the files, and when the dialog box appears, their will be checkboxes next to each file. Uncheck the files you do not want to submit.

How do you update shelved files?

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.

What are shelved files in Perforce?

Shelving in Perforce allows users to store and share file snapshots on the central server. This can be useful for allowing others to review your work, moving your progress to another workspace, validating builds on multiple platforms, and preserving your work so that you can work on another project.


Video Answer


1 Answers

You need to run p4 shelve -d -c (cl-number) (file).

See also p4 help shelve.

like image 59
sferencik Avatar answered Oct 15 '22 18:10

sferencik