Skip to content Skip to sidebar Skip to footer

Pysvn Get Latest Revision Number For Specific Directory (not Head)

I'm trying to find the latest revision number for a specific directory in the svn root, without needing to create a working copy. I know many applications can do this, but I need t

Solution 1:

I had the same problem (Lord Gamez solution did not work for me).

I solved it with:

svnrev = client.info2(WORKING_COPY_DIR)[0][1]['last_changed_rev'].number

Solution 2:

I had the same issue I solved it with pysvn client's info2 function:

defget_revision_number_of_directory(self, localPath):
    head_rev = pysvn.Revision(pysvn.opt_revision_kind.head)
    info = self.__client.info2(localPath, revision=head_rev, recurse=False)
    return info[0][1]['rev'].number

Post a Comment for "Pysvn Get Latest Revision Number For Specific Directory (not Head)"