本手册描述了 Apache™ Subversion® 的 1.7.x 系列。如果您运行的是其他版本的 Subversion,强烈建议您访问 https://svnbook.subversion.org.cn/ 并查阅适合您 Subversion 版本的手册。

名称

svnlook tree — 打印树结构。

概要

svnlook tree REPOS_PATH [PATH_IN_REPOS]

描述

打印树结构,从 PATH_IN_REPOS 开始(如果提供;否则从树根开始),可以选择显示节点修订版本 ID。

选项

示例

这显示了我们示例仓库中修订版本 13 的树结构输出。

$ svnlook tree -r 13 /var/svn/repos
/
 trunk/
  button.c
  Makefile
  integer.c
 branches/
  bookstore/
   button.c
   Makefile
   integer.c
…

使用 --show-ids 选项包含节点修订版本 ID(Subversion 版本控制文件系统实现中特定节点的唯一内部标识符)。

$ svnlook tree -r 13 /var/svn/repos --show-ids
/ <0.0.r13/811>
 trunk/ <1.0.r9/551>
  button.c <2.0.r9/238>
  Makefile <3.0.r7/41>
  integer.c <4.0.r6/98>
 branches/ <5.0.r13/593>
  bookstore/ <1.1.r13/390>
   button.c <2.1.r12/85>
   Makefile <3.0.r7/41>
   integer.c <4.1.r13/109>
…

对于更易于脚本解析的输出,请使用 --full-paths 选项,这将导致 svnlook 打印每个树项的完整仓库路径,并且不使用缩进表示层次结构。

$ svnlook tree -r 13 /var/svn/repos --show-ids --full-paths
/ <0.0.r13/811>
trunk/ <1.0.r9/551>
trunk/button.c <2.0.r9/238>
trunk/Makefile <3.0.r7/41>
trunk/integer.c <4.0.r6/98>
branches/ <5.0.r13/593>
branches/bookstore/ <1.1.r13/390>
branches/bookstore/button.c <2.1.r12/85>
branches/bookstore/Makefile <3.0.r7/41>
branches/bookstore/integer.c <4.1.r13/109>
…