pysvn 获取特定目录(不是头)的最新修订号 [英] pysvn get latest revision number for specific directory (not head)
问题描述
我正在尝试在 svn 根目录中查找特定目录的最新修订号,而无需创建工作副本.我知道很多应用程序都可以做到这一点,但我需要使用 python 以编程方式获取信息.
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 to get the info programatically with python.
我已经尝试过:
myUrl = "https://user@svnBranch/mydir"
rev = client.info(myUrl).revision.number
它告诉我这不是工作副本.
and it tells me that this isn't a working copy.
我试过了:
myUrl = "https://user@svnBranch/mydir"
rev = client.revpropget("revision", url=myUrl)[0].number
它给了我存储库的主版本号,而不是特定目录中的最新版本.
and it gives me the head revsion number of the repository not the latest version in the specific directory.
我尝试过的其他几种方法也给我带来了同样的问题.
A couple of other methods I have tried give me the same issues.
有人发现了吗?
推荐答案
我遇到了同样的问题(Lord Gamez 解决方案对我不起作用).
I had the same problem (Lord Gamez solution did not work for me).
我解决了:
svnrev = client.info2(WORKING_COPY_DIR)[0][1]['last_changed_rev'].number
这篇关于pysvn 获取特定目录(不是头)的最新修订号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!