title: Delete a Perforce client workspace with pending files when the workspace has already been removed from disk?
body: <p>How do I delete a workspace that has pending files when that workspace has already been removed from disk?</p>
  
  <h1>Caveats:</h1>
  
  <ul>
  <li>p4 command line only; not p4v gui</li>
  <li>regular user access; no admin access</li>
  </ul>
  
  <h1>Scenario:</h1>
  
  <ul>
  <li>create a workspace named <code>user_workspace</code> on the disk in the <code>~/my_workspace</code> directory</li>
  <li>p4 edit files in workspace on the default pending changelist</li>
  <li>remove workspace by hand (<code>rm -rf ~/my_workspace</code>)
  <ul>
  <li>workspace still exists on server with pending files</li>
  </ul></li>
  </ul>
  
  <h1>Solutions that don't work:</h1>
  
  <h2>1: Delete workspace</h2>
  
  <p>Doesn't work because the workspace has files opened.</p>
  
  <p><code>p4 client -d user_workspace</code></p>
  
  <p>Client 'user_workspace' has files opened; use -f to force delete.</p>
  
  <h2>2: Delete workspace with force</h2>
  
  <p>Doesn't work because not admin.</p>
  
  <p><code>p4 client -d -f user_workspace</code></p>
  
  <p>You don't have permission for this operation.</p>
  
  <h2>3: Delete the pending changelist; then delete workspace (try 1)</h2>
  
  <p><code>p4 changes -c user_workspace -s pending</code></p>
  
  <p>Only lists pending numbered changelists, does not handle the default pending changelist.</p>
  
  <p><code>p4 -c user_workspace -d changelist_number</code></p>
  
  <p>Not possible because there is no changelist number for the pending changelist.</p>
  
  <h2>4: Delete the pending changelist; then delete workspace (try 2)</h2>
  
  <p>Trying to do a p4 revert on a directory that does not exist anymore gives a strange error.</p>
  
  <p><code>p4 revert ~/my_workspace</code></p>
  
  <p>/home/user/my_workspace - must refer to client 'user_workspace'.</p>
  
  <p><code>p4 -c user_workspace revert ~/my_workspace</code></p>
  
  <p>/home/user/my_workspace - must refer to client 'user_workspace'.</p>
  
  <p><code>setenv P4CLIENT user_workspace; p4 -c user_workspace revert ~/my_workspace</code></p>
  
  <p>/home/user/my_workspace - must refer to client 'user_workspace'.</p>