svn status — 打印工作拷貝文件和目錄的狀態。

名稱
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>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章