In pysvn, how do I test if a file is under version control?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
client.status()and check thetext_statusattribute of the returned status object. Example:That shows the file is versioned and unmodified.
You can explore other possible statuses using
dir (pysvn.wc_status_kind)You can therefore wrap that up in something like:
If you wish to also address files outside an svn working directory, you’ll need to catch and handle
ClientError. E.g.