您可以使用svn info <URL>
命令来确定路径是代表文件还是目录。
运行命令svn info http://svn.apache.org/repos/asf/subversion/trunk/tools
,结果将是:
Path: tools
URL: http://svn.apache.org/repos/asf/subversion/trunk/tools
Relative URL: ^/subversion/trunk/tools
Repository Root: http://svn.apache.org/repos/asf
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 1663737
Node Kind: directory
Last Changed Author: danielsh
Last Changed Rev: 1663005
Last Changed Date: 2015-03-01 00:31:24 +0300 (Sun, 01 Mar 2015)
“Node Kind:directory”条目表示/asf/subversion/trunk/tools
是一个目录。
运行命令svn info http://svn.apache.org/repos/asf/subversion/trunk/README
,结果将是:
Path: README
Name: README
URL: http://svn.apache.org/repos/asf/subversion/trunk/README
Relative URL: ^/subversion/trunk/README
Repository Root: http://svn.apache.org/repos/asf
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 1663738
Node Kind: file
Last Changed Author: danielsh
Last Changed Rev: 1242804
Last Changed Date: 2012-02-10 18:58:53 +0400 (Fri, 10 Feb 2012)
“Node Kind:file”条目表示/asf/subversion/trunk/README
是一个文件。
您可以在命令中添加--xml
命令行选项以svn info
获取更易于解析的 XML 输出:
svn info http://svn.apache.org/repos/asf/subversion/trunk/README --xml
<?xml version="1.0" encoding="UTF-8"?>
<info>
<entry
path="README"
revision="1663740"
kind="file">
<url>http://svn.apache.org/repos/asf/subversion/trunk/README</url>
<relative-url>^/subversion/trunk/README</relative-url>
<repository>
<root>http://svn.apache.org/repos/asf</root>
<uuid>13f79535-47bb-0310-9956-ffa450edef68</uuid>
</repository>
<commit
revision="1242804">
<author>danielsh</author>
<date>2012-02-10T14:58:53.499287Z</date>
</commit>
</entry>
</info>