名称

svn status — 打印工作拷贝文件和目录的状态。

概要

svn status [PATH...]

描述

Print the status of working copy files and directories. With no arguments, it prints only locally modified items (no repository access). With --show-updates, it adds working revision and server out-of-date information. With --verbose, it prints full revision information on every item. With --quiet, it prints only summary information about locally modified items.

输出的前六列都是一个字符宽,每一列给出了工作拷贝项目的每一方面的信息。

第一列指出一个项目的是添加、删除还是其它的修改。

' '

没有修改。

'A'

Item is scheduled for addition.

'D'

Item is scheduled for deletion.

'M'

项目已经修改了。

'R'

项目在工作拷贝中已经被替换了。这意味着文件预定要删除,然后有一个同样名称的文件要在同一个位置替换它。

'C'

项目的内容(相对于属性)与更新得到的数据冲突了。

'X'

项目与外部定义相关。

'I'

Item is being ignored (e.g., with the svn:ignore property).

'?'

项目不在版本控制之下。

'!'

项目已经丢失(例如,你使用svn移动或者删除了它)。这也说明了一个目录不是完整的(一个检出或更新中断)。

'~'

项目作为一种对象(文件、目录或链接)纳入版本控制,但是已经被另一种对象替代。

第二列告诉一个文件或目录的属性的状态。

' '

没有修改。

'M'

这个项目的属性已经修改。

'C'

这个项目的属性与从版本库得到的更新有冲突。

第三列只在工作拷贝锁定时才会出现。(见“有时你只需要清理”一节。)

' '

项目没有锁定。

'L'

项目已经锁定。

第四列只在预定包含历史添加的项目出现。

' '

没有历史预定要提交。

'+'

历史预定要伴随提交。

第五列只在项目跳转到相对于它的父目录时出现(见“使用分支”一节)。

' '

项目是它的父目录的孩子。

'S'

项目已经转换。

第六列显示锁定信息。

' '

当使用--show-updates,文件没有锁定。如果使用--show-updates,这意味着文件在工作拷贝被锁定。

K

文件锁定在工作拷贝。

O

File is locked either by another user or in another working copy. This appears only when --show-updates is used.

T

File was locked in this working copy, but the lock has been “stolen” and is invalid. The file is currently locked in the repository. This appears only when --show-updates is used.

B

File was locked in this working copy, but the lock has been “broken” and is invalid. The file is no longer locked. This appears only when --show-updates is used.

过期信息出现在第七列(只在使用--show-updates选项时出现)。

' '

The item in your working copy is up to date.

'*'

在服务器这个项目有了新的修订版本。

余下的字段是可变得宽度且使用空格分隔,如果使用--show-updates--verbose选项,工作修订版本是下一个字段。

如果传递--verbose选项,最后提交的修订版本和最后的提交作者会在后面显示。

工作拷贝路径永远是最后一个字段,所以它可以包括空格。

别名

stat, st

改变

无2

是否访问版本库

只有使用--show-updates时会访问

选项

--show-updates (-u)
--verbose (-v)
--depth ARG
--quiet (-q)
--no-ignore
--incremental
--xml
--username USER
--password PASS
--no-auth-cache
--non-interactive
--config-dir DIR
--ignore-externals
--changelist ARG

例子

这是查看你在工作拷贝所做的修改的最简单的方法。

$ svn status wc
 M     wc/bar.c
A  +   wc/qax.c

如果你希望找出工作拷贝哪些文件是最新的,使用--show-updates选项(这不会对工作拷贝有任何修改)。这里你会看到wc/foo.c在上次更新后有了修改:

$ svn status --show-updates wc
 M           965    wc/bar.c
       *     965    wc/foo.c
A  +         965    wc/qax.c
Status against revision:    981

注意

--show-updates只会在过期的项目(如果你运行svn update,就会更新的项目)旁边安置一个星号。--show-updates不会导致状态列表反映项目的版本库版本(尽管你可以通过--verbose选项查看版本库的修订版本号)。

And finally, the most information you can get out of the status subcommand is as follows:

$ svn status --show-updates --verbose wc
 M           965       938 sally        wc/bar.c
       *     965       922 harry        wc/foo.c
A  +         965       687 harry        wc/qax.c
             965       687 harry        wc/zig.c
Head revision:   981

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

$ svn status --xml wc
<?xml version="1.0"?>
<status>
<target
   path="wc">
<entry
   path="qax.c">
<wc-status
   props="none"
   item="added"
   revision="0">
</wc-status>
</entry>
<entry
   path="bar.c">
<wc-status
   props="normal"
   item="modified"
   revision="965">
<commit
   revision="965">
<author>sally</author>
<date>2008-05-28T06:35:53.048870Z</date>
</commit>
</wc-status>
</entry>
</target>
</status>

关于svn status的更多例子可以见“查看你的修改概况”一节