如何使用 pysvn 检查工作副本是否干净?

How to check if the working copy is clean using pysvn?

我想使用 pysvn 来确定工作副本的修订以及其内容是否与存储库中的内容相同(对于相同的修订)。

获取修订号没有问题,但我如何找出工作副本中是否有任何未提交的更改。所以我正在寻找等效于检查 svn status --ignore-externals 是否没有不以 X.

开头的行

我设法做到了:

def has_no_modifications(path_to_repository)
    statuses = client.status(path_to_repository, ignore=True, recurse=True)
    statuses = [s for s in statuses if s.data['text_status'] != pysvn.wc_status_kind.normal]
    return len(statuses) == 0