名称

svn propget (pget, pg) — 打印一个属性的值。

概要

svn propget PROPNAME [TARGET[@REV]...]

svn propget PROPNAME --revprop -r REV [URL]

描述

Print the value of a property on files, directories, or revisions. The first form prints the versioned property of an item or items in your working copy, and the second prints unversioned remote properties on a repository revision. See 第 3 节 “属性” for more information on properties.

选项

--changelist ARG
--depth ARG
--recursive (-R)
--revision (-r) REV
--revprop
--strict
--verbose (-v)
--xml

例子

检查工作副本的一个文件的一个属性:

$ svn propget svn:keywords foo.c
Author
Date
Rev

对于修订版本属性相同:

$ svn propget svn:log --revprop -r 20 
Began journal.

For a more structured display of properties, use the --verbose (-v) option:

$ svn propget svn:keywords foo.c --verbose
Properties on 'foo.c':
  svn:keywords
    Author
    Date
    Rev

By default, svn propget will append a trailing end-of-line sequence to the property value it prints. Most of the time, this is a desirable feature that has a positive effect on the printed output. But there are times when you might wish to capture the precise property value, perhaps because that value is not textual in nature, but of some binary format (such as a JPEG thumbnail stored as a property value, for example). To disable pretty-printing of property values, use the --strict option.

Lastly, you can get svn propget output in XML format with the --xml option:

$ svn propget --xml svn:ignore .
<?xml version="1.0"?>
<properties>
<target
   path="">
<property
   name="svn:ignore">*.o
</property>
</target>
</properties>