How to delete pending changelist in perforce

来源:互联网 发布:韩顺平 linux视频教程 编辑:程序博客网 时间:2024/05/21 10:45

How to delete pending changelist in perforce

 

up vote24down votefavorite

10

I 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. Thanks

share|improve this question

        asked Sep 6 '12 at 8:34

Steve Mark
131113

 

 

 

 

8 Answers                                8

activeoldestvotes

 

up vote28down vote

Run 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 answer

edited 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

 

 

up vote22down vote

Why it's only 11 clicks in P4V, through an arbitrary sequence of menu items.

  1. Right click on the changelist
  2. Delete shelved files
  3. 'Yes'
  4. Right click on the changelist
  5. Remove all jobs
  6. Right click on the changelist
  7. Revert files
  8. 'Revert'
  9. Right click on the changelist
  10. Delete pending changelist
  11. 'Yes'

Let's send Perforce to usability school.

share|improve this answer

edited Jun 20 '13 at 9:35

 


 

        answered Feb 14 '13 at 10:01

Colonel Panic
27.3k15118179

 

 

 

 

up vote5down vote

Here 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 answer

        answered 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

 

up vote2down vote

Here's a scriptable procedure for deleting a Perforce client. Use with care: this deletes all your work in progress on the client!

  1. 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.

  2. 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.

  3. 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

  4. 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 answer

edited 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

 

up vote1down vote

Wrote this script called p4-delete-client for deleting p4 changelists.

Note that it relies on other scripts in the repo.

share|improve this answer

edited Aug 12 at 9:04

 


 

        answered Aug 4 at 6:48

Arnon Zilca
886215

 

 

 

 

up vote0down vote

try those steps :

  1. 1.Right click on the changelist

  2. Choose 'Change Ownership'

  3. In the workspace box choose already existing workspace and click OK

  4. right click on changelist  and choose delete and than ok.

share|improve this answer

        answered Aug 25 at 11:30

aristotaly
132111

 

 

 

 

up vote0down vote

try those steps (P4V) :

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 answer

        answered Aug 25 at 11:32

aristotaly
132111

 

 

 

 

up vote0down vote

This just worked for me in P4V for resetting the default changelist:

  1. Right click on the default changelist and choose "Edit Pending Changelist 'default'"

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

  3. 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 answer

        answered Aug 28 at 3:35

John Starr Dewar
7611011

 

http://stackoverflow.com/questions/12296080/how-to-delete-pending-changelist-in-perforce/14872182

0 0
原创粉丝点击