Deleting a changelist with shelved files
来源:互联网 发布:win7恢复网络设置 编辑:程序博客网 时间:2024/04/30 22:33
Information
A changelist cannot be deleted if it contains shelved files. For example:
p4 change -d 523Change 523 has shelved files associated with it and can't be deleted.
How can I delete a changelist with shelved files?
A changelist containing shelved files cannot be deleted; you must first delete those shelved files. This is also referred to as 'deleting the shelved change'.
Deleting files you shelved in your workspace
To find out which files are shelved in a given change, you can use 'p4 describe -s -S change_number' . The upper-case '-S' shows files that are shelved in this changelist. For example:
> p4 describe -s -S 7033Change 7033 by norman@graze on 2014/04/08 20:40:01 *pending* shelving a fileShelved files ...... //depot/source/file0.txt#4 edit
To delete the shelved files, use 'p4 shelve -d', followed by the change number:
> p4 shelve -d -c 7033Shelved change 7033 deleted.
Having removed the shelved files (deleting the shelved change), you can remove the change itself:
> p4 change -d 7033Change 7033 deleted.
Deleting files shelved by another user or workspace
The changelist containing shelved files can be associated with a different user or client workspace. Deleting such files requires impersonating that user or workspace. Alternatively, deleting files shelved by another user can be done by a user with 'super' or 'admin' permissions.
You can determine the user and client by inspecting the change using 'p4 describe -s -S changenumber' (as above), and the Perforce Server will tell you if it's the wrong user/client - for example:
> p4 shelve -d -c 7202Change 7202 belongs to client min-graze.
I am not working in client 'min-graze', but I can impersonate the client by adding it to my command:
> p4 -c min-graze shelve -d -c 7202Client 'min-graze' can only be used from host 'min'.
This client, min-graze, is tied to a specific host; adding the client's host name to my command:
> p4 -c min-graze -H min shelve -d -c 7202Change 7202 belongs to user norman.
The change is owned by a different user; adding the username too:
> p4 -c min-graze -H min -u norman shelve -d -c 7202Shelved change 7202 deleted.
Note that you may need a valid login ticket for this user (more about impersonating users can be found in "Reverting Another User's Files").
Alternatively, a user with 'admin' access can delete shelved files by including the -f flag to force the operation:
> p4 -u admin shelve -d -c 7202 -fShelved change 7202 deleted.
Change has shelved files, but the owner cannot see them.
Sometimes, a change in protections means a user is no longer allowed to access a file they have shelved. To unshelve these files requires either a change in the protections table (needing a super user) or, more conveniently, an admin user to run the 'p4 shelve -d' command. For example, user 'norman' shelves a file:
> p4 -u norman shelve -c 7202 //depot/source/file0.txtShelving files for change 7202.edit //depot/source/file0.txt#5Change 7202 files shelved.
The protections table is updated. The pending change containing those shelved files still exists...
> p4 -u norman changes -s pending -c min-grazeChange 7202 on 2014/06/16 by norman@min-graze *pending* 'Shelving a file in this change '
... but the owner of that change cannot delete the change nor view the shelved files in that change:
> p4 -u norman change -d 7202Change 7202 has shelved files associated with it and can't be deleted.> p4 -u norman describe -s -S 7202Change 7202 by norman@min-graze on 2014/06/16 11:12:23 *pending* Shelving a file in this changeShelved files ...[ no files listed ]
An admin user can view and delete the shelved files...
> p4 -u admin describe -s -S 7202Change 7202 by norman@min-graze on 2014/06/16 11:12:23 *pending* Shelving a file in this changeShelved files ...... //depot/source/file0.txt#5 edit> p4 -u admin shelve -d -f -c 7202Shelved change 7202 deleted.
... which allows 'norman' to delete his pending change.
> p4 -u norman change -d 7202Change 7202 deleted.
Viewing or saving a shelved file
Use the p4 print command if you want to save off shelved files before deleting shelves.p4 print -q //depot/source/file0.txt@=7202 > shelve_7202_file0.txt
Opened Files Missing in Default Changelist
Reverting Another User's Files
- Deleting a changelist with shelved files
- RegOpenKeyEx---Deleting a Key with Subkeys
- What is a Perforce "shelved" file?
- What is a Perforce "shelved" file?
- Deleting a Service
- Deleting a git commit
- Python 3.5 deleting specified files recursively
- creating a Self Deleting Executable
- Windows 7: Could not find this item - when deleting files
- a sample for deleting duplicated records
- What is a Perforce "shelved" fil…
- Working with Files
- Uploading Files With PHP
- Transferring Files With FTP
- Input/Output with files
- Input/Output with files
- Sharing Files with NFC
- Manipulating Files With Tcl
- 1
- 注解机制 androidannotations 让编程更随性,更轻松(二)
- 单点登录SSO的实现原理
- makefile
- jstat 详解
- Deleting a changelist with shelved files
- spark:学习杂记--24
- 经典表达式栈实现
- 第二章第十一题(改正后)
- 完全跨域的单点登录SSO
- win7 下修改无限网卡Mac地址
- lib和dll文件的区别和联系
- Android Studio系列教程六--Gradle多渠道打包
- 笔记本之间大文件相传