本文档仍在编写中,内容可能会发生较大变化,可能无法准确描述 Apache™ Subversion® 软件的任何已发布版本。将此页面添加为书签或推荐给其他人可能不是一个好主意。请访问 https://svnbook.subversion.org.cn/ 获取此书的稳定版本。
svn info — 显示本地或远程项目的信息。
svn info [TARGET[@REV]...]
打印指定工作副本路径或 URL 的信息。显示的每个路径信息可能包括(与该路径上的对象相关):
版本控制对象所在的存储库的信息
对指定版本的对象进行的最新提交
对对象持有的任何用户级锁
本地调度信息(添加、删除、复制等)
本地冲突信息
svn info 将显示它对工作副本中项目的所有有用信息。它将显示文件的信息
$ svn info foo.c Path: foo.c Name: foo.c Working Copy Root Path: /home/sally/projects/test URL: http://svn.red-bean.com/repos/test/foo.c Relative URL: ^/foo.c Repository Root: http://svn.red-bean.com/repos/test Repository UUID: 5e7d134a-54fb-0310-bd04-b611643e5c25 Revision: 4417 Node Kind: file Schedule: normal Last Changed Author: sally Last Changed Rev: 20 Last Changed Date: 2003-01-13 16:43:13 -0600 (Mon, 13 Jan 2003) Text Last Updated: 2003-01-16 21:18:16 -0600 (Thu, 16 Jan 2003) Properties Last Updated: 2003-01-13 21:50:19 -0600 (Mon, 13 Jan 2003) Checksum: d6aeb60b0662ccceb6bce4bac344cb66
它还会显示目录的信息
$ svn info vendors Path: vendors Working Copy Root Path: /home/sally/projects/test URL: http://svn.red-bean.com/repos/test/vendors Relative URL: ^/vendors Repository Root: http://svn.red-bean.com/repos/test Repository UUID: 5e7d134a-54fb-0310-bd04-b611643e5c25 Revision: 19 Node Kind: directory Schedule: normal Last Changed Author: harry Last Changed Rev: 19 Last Changed Date: 2003-01-16 23:21:19 -0600 (Thu, 16 Jan 2003) Properties Last Updated: 2003-01-16 23:39:02 -0600 (Thu, 16 Jan 2003)
svn info 也对 URL 起作用(还要注意,此示例中的文件 readme.doc
被锁定,因此也提供了锁定信息)
$ svn info http://svn.red-bean.com/repos/test/readme.doc Path: readme.doc Name: readme.doc URL: http://svn.red-bean.com/repos/test/readme.doc Relative URL: ^/readme.doc Repository Root: http://svn.red-bean.com/repos/test Repository UUID: 5e7d134a-54fb-0310-bd04-b611643e5c25 Revision: 1 Node Kind: file Schedule: normal Last Changed Author: sally Last Changed Rev: 42 Last Changed Date: 2003-01-14 23:21:19 -0600 (Tue, 14 Jan 2003) Lock Token: opaquelocktoken:14011d4b-54fb-0310-8541-dbd16bd471b2 Lock Owner: harry Lock Created: 2003-01-15 17:35:12 -0600 (Wed, 15 Jan 2003) Lock Comment (1 line): My test lock comment
最后,通过传递 --xml
选项,可以以 XML 格式获取 svn info 输出
$ svn info --xml http://svn.red-bean.com/repos/test <?xml version="1.0"?> <info> <entry kind="dir" path="." revision="1"> <url>http://svn.red-bean.com/repos/test</url> <relative-url>^/</relative-url> <repository> <root>http://svn.red-bean.com/repos/test</root> <uuid>5e7d134a-54fb-0310-bd04-b611643e5c25</uuid> </repository> <wc-info> <schedule>normal</schedule> <depth>infinity</depth> </wc-info> <commit revision="1"> <author>sally</author> <date>2003-01-15T23:35:12.847647Z</date> </commit> </entry> </info>