Python library for getting information about SVN repository?

AndiDog picture AndiDog · Dec 17, 2010 · Viewed 8k times · Source

I'm searching for a library that can extract (at least) the following information from a SVN repository (not a working copy!):

  • Revision numbers and their author & commit message
  • Changes in each revision (added, deleted, modified files)

Is there a Python library that can do this?

For the authors and commit messages, I could parse "db/revprops/0/..." (simple format), but looking for changed files does not seem so easy, so I'd rather stick with a library that supports SVN repos.

Answer

Sven Marnach picture Sven Marnach · Dec 17, 2010

There are Python bindings to libsvn: http://pysvn.tigris.org/docs/pysvn.html. They facilitate doing pretty much everything the svn command line client can do.

In particular, the Client.log() method does what you are looking for.