How to revert and checkin files that another user has checked out

Dec 13th, 2016 | By | Category: Technology

My afternoon was hijacked today when a user decided to mark an entire project for deletion, joy of joys.  So as I had to step out I told him to just revert his entire project, but at a few dozen GB by the time I got back and hour and change later it was still going and every single member of the dev team was now blocked from committing anything as he had all of the files checked out.  Turns out it’s pretty quick and easy to fix this if you just go into the server and do the revert there instead of on the client where they have to download everything one at a time

The first method is to revert all checked out files and requires server access:

  1. #p4 -p localhost:5666 login
  2. Check on the damage and find the name of his workspace #p4 -p localhost:5666 changes -u {USERNAME}
  3. Revert ALL his changes at the source(took 7 seconds) #p4 -p localhost:5666 revert -C {WORKSPACE NAME} //…
    1. Note that you can revert individual files if you want

The second method is to revert specific files one at a time and requires admin access but can be done from the client side:

#1 ) p4 -p server:3666 login {YourUsername}

#2) p4 -p server:3666 opened -u {NaughtyUser}

#3) Find out the name of his workspace and copy paste it into #4

#4) p4 -p server:3666 revert -C {Workspace} Filename and Path from #2


Tags: , ,

Leave a Comment