您的位置:首页 > 其它

How to delete pending changelist in perforce

2014-12-01 12:30 8361 查看

How to delete pending changelist in perforce

up vote24down votefavorite10I have a workspace in perforce in which i made some files mark for delete. Now i want to delete that workspace forcefully. But i dont have admin rights. What to do. Please suggest some method. Thanksperforce
share|improve this questionasked Sep 6 '12 at 8:34

Steve Mark
131113
add a comment |
8 Answers 8activeoldestvotes
up vote28down voteRun
p4 opened
to see all your opened files and run
p4 revert
to revert them.Then run
p4 changes -c your-client-name -s pending
to see all your pending changelists. Since in the first step you reverted all your open files, these changelists will all be empty. Run
p4 change -d change-number
to delete each empty pending changelist.Then you can run
p4 client -d
to delete your client.
share|improve this answeredited Sep 6 '12 at 20:11

Dennis
10.2k12547
answered Sep 6 '12 at 13:46

Bryan Pendleton
8,36921019
2
For reverting and deleting a pending changelist, I prefer this sequence:
p4 changes -u joe
to list my pending changelists;
p4 revert -c 12345 //...
to revert all files in my pending changelist 12345 (for example);
p4 change -d 12345
to delete the now-empty changelist. HTH.– JeffroOct 19 '13 at 16:46
add a comment |
up vote22down voteWhy it's only 11 clicks in P4V, through an arbitrary sequence of menu items.Right click on the changelist
Delete shelved files
'Yes'
Right click on the changelist
Remove all jobs
Right click on the changelist
Revert files
'Revert'
Right click on the changelist
Delete pending changelist
'Yes'
Let's send Perforce to usability school.
share|improve this answeredited Jun 20 '13 at 9:35
answered Feb 14 '13 at 10:01

Colonel Panic
27.3k15118179
add a comment |
up vote5down voteHere is what I did to empty my default change set, which had a lot of files checked out for edit:
p4 opened | sed 's/#.*$//g' |  xargs -iF p4 revert F
This will cut off the comment part from the filename produced by
p4 opened
and pipe the filename to
p4 revert
. After that I had nothing pending and
p4 changes -c my-client-name -s pending
yields nothing. If you have a huge change set this will take a while.
share|improve this answeranswered Apr 4 '13 at 13:15

Juve
3,32042746
Love this.. Thanks Man!– Atif Mohammed AmeenuddinFeb 11 at 7:49
No need for
xargs
here (and especially no need for the
-i
option, which is unportable and deprecated even on Linux). Use
p4 -x -
instead (see
p4 help usage
). Also, to avoid the wait when you have a huge change set, use the
-k
option to
p4 revert
.– Gareth ReesMar 31 at 12:41
add a comment |
up vote2down voteHere's a scriptable procedure for deleting a Perforce client. Use with care: this deletes all your work in progress on the client!Revert all changed files on this client.
p4 -c $CLIENT revert -k //...
Note the use of the
-k
option, which "marks the file as reverted in server metadata without altering files in the client workspace". Since we are going to delete the client later, we don't care about updating the client workspace. This speeds things up if you have many files open.

Delete all shelved files from pending changes associated with the client.
p4 changes -s shelved -c $CLIENT | cut -d' ' -f2 |while read CHANGE; do p4 shelve -c $CHANGE -d //...; done
If you never use
p4 shelve
you can omit this step.

All pending changes associated with the client are now empty. Delete them.
p4 changes -s pending -c $CLIENT | cut -d' ' -f2 | p4 -b 1 -x - change -d

There are now no pending changes associated with the client. Delete the client.
p4 client -d $CLIENT

(This process ought to be much easier! In particular, there seems no good reason why we have to delete shelved files associated with a client before deleting the client. If you find yourself struggling with this, do contact Perforce support and suggest that it be made simpler.)
share|improve this answeredited Sep 4 at 20:16
answered Mar 31 at 10:59

Gareth Rees
32.9k356102
I had shelved changes on another host (after switching computers). To be able to do step 2, I had to change the host of the workspace to my current one.– tunerJul 22 at 16:05
The help suggests that you can use the
-f
option to force the deletion despite the mismatch. (You'll need "admin" permission though.)– Gareth ReesJul 22 at 16:54
The question was explicitly telling that no admin rights are available. I guess that is the case for most people who do professional work (=being paid for) with perforce.– tunerJul 23 at 8:08
Awesome! Step 3 didn't work for me. Was getting "Usage: change -d [ -f ] [ -O ] changelist# Missing/wrong number of arguments." Slight modification worked (Mavericks): p4 changes -s pending -c $CLIENT | cut -d' ' -f2 | xargs -n 1 p4 change -d– MoosSep 4 at 19:55
@Moos: Thanks for spotting my mistake! As an alternative to
xargs
, you can use
-b 1
to batch the arguments to
p4
.– Gareth ReesSep 4 at 20:17
add a comment |
up vote1down voteWrote this script called p4-delete-client for deleting p4 changelists.Note that it relies on other scripts in the repo.
share|improve this answeredited Aug 12 at 9:04
answered Aug 4 at 6:48

Arnon Zilca
886215
add a comment |
up vote0down votetry those steps :1.Right click on the changelist

Choose 'Change Ownership'

In the workspace box choose already existing workspace and click OK

right click on changelist and choose delete and than ok.
share|improve this answeranswered Aug 25 at 11:30

aristotaly
132111
add a comment |
up vote0down votetry those steps (P4V) :1.Right click on the changelistChoose 'Change Ownership'In the workspace box choose already existing workspace and click OKright click on changelist and choose delete and than ok.
share|improve this answeranswered Aug 25 at 11:32

aristotaly
132111
add a comment |
up vote0down voteThis just worked for me in P4V for resetting the default changelist:Right click on the default changelist and choose "Edit Pending Changelist 'default'"

Click the button on the bottom right "Save as numbered changelist"

Right click on the new changelist and choose "Delete changelist XXX"

You can also right click on the new changelist to revert the files for whatever you need to do, which is not available as an option on the default changelist.
share|improve this answeranswered Aug 28 at 3:35

John Starr Dewar
7611011
http://stackoverflow.com/questions/12296080/how-to-delete-pending-changelist-in-perforce/14872182
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: