I'm using pysvn to monitor the changes in a Subversion directory. This is how i get informations from revisions:
(...)
svn_root = "http://svn/"
client = pysvn.Client()
from_revision = pysvn.Revision(pysvn.opt_revision_kind.number, 1500)
to_revision = pysvn.Revision( pysvn.opt_revision_kind.head )
revisions = client.log(svn_root, to_revision, to_revision, discover_changed_paths=True)
Now I want to get the changes not from a specific revision, like in my example, but the changes within the last 5 revisions (from head - 5
to head
). How can I accomplish that? How can i get the NUMBER of the head revision?
I could do it by calling the Shell from Python. But I guess that there is a "Pythonic" way for that using pysvn.