Return unused files in perforce

I have an unhelved cl containing a file called 'add' called foo.txt. When I return this change list, foo.txt disappears from my workspace but remains on my hdd.

p4 unshelve -f -s $A -c default :: unshelving add foo.txt p4 revert -c default //MY_WORKSPACE/... :: foo.txt is reverted p4 opened -C MY_WORKSPACE :: shows none 

When I open the workspace, I still see foo.txt.

Is there any way to delete the added file? (Except for the obvious manual removal)

+6
source share
3 answers

This design behavior.

http://www.perforce.com/perforce/doc.current/manuals/p4guide/04_files.html

Discard changes (refund)

To remove an open file from the list of changes and discard any changes you made, issue the p4 revert command. When you return the file, Perforce restores the latest version you synchronized with your workspace. If you return a file open for add, the file is removed from the change list, but not deleted from your workspace.

+2
source

Running the revert command with the -w flag will delete all files marked for addition during the return (see p4_revert docs )

p4 revert -w [file specification]

e.g. p4 revert -w -c default //MY_WORKSPACE/... (foo.txt is removed from disk and then returned)

+2
source

Once you have returned the file to Perforce, I think you can just delete it from the disk - Perforce completely forgot about them.

0
source

Source: https://habr.com/ru/post/943456/


All Articles