tabishm
tabishm

Reputation: 43

Get working copy root path using pysvn

When I run the SVN command 'svn info path', the SVN command line client (v1.8.4) spits out (among other things) a 'Working Copy Root Path'.

How would I get this same information using pysvn? Seems like it should be available using the either pysvn.Client.info() or pysvn.Client.info2(), but it doesn't seem to me that it's there.

Upvotes: 4

Views: 282

Answers (1)

ACK_stoverflow
ACK_stoverflow

Reputation: 3305

Unfortunately it seems like, even nine years later, there's still no way to directly get the wc-root via pysvn. The only way I've found to do it is with the svn command line client. Something like:

def get_working_copy_root(path="."):
    return subprocess.check_output(["svn", "info", "--show-item", "wc-root", path]).decode("utf-8").strip()

Upvotes: 1

Related Questions