code_junkie

How to find out whether subversion working directory is locked by svn?

Nov 11th, 2011
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. if os.path.isdir(checkout_dir):
  2. # working copy dir already exists
  3. return checkout_dir
  4.  
  5. checked-out failed: svn: Working copy '/tmp/qm_23683' locked
  6. svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)**
  7.  
  8. import os, errno
  9.  
  10. # ...
  11.  
  12. try:
  13. os.mkdir(dirName)
  14. except OSError, e:
  15. if e.errno != errno.EEXIST: raise # some other error
  16. print 'Directory already exists.'
  17. else:
  18. print 'Successfully created new directory.'
Add Comment
Please, Sign In to add comment