Subversion

Kiểm tra các đổi trên bản làm việc của bạn

Bạn có thể sử dụng lệnh svn status [thành_phần_muốn_kiểm_tra] để kiểm tra các thay đổi trên bản làm việc của mình từ lần cuối bạn cập nhật từ repo.

Các chữ viết tắt chỉ tình trạng bạn có thể gặp

L some_dir # svn left a lock in the .svn area of some_dir
M bar.c # the content in bar.c has local modifications
M baz.c # baz.c has property but no content modifications
X 3rd_party # dir is part of an externals definition
? foo.o # svn doesn't manage foo.o
! some_dir # svn manages this, but it's missing or incomplete
~ qux # versioned as file/dir/link, but type has changed
I .screenrc # svn doesn't manage this, and is set to ignore it
A + moved_dir # added with history of where it came from
M + moved_dir/README # added with history and has local modifications
D stuff/fish.c # file is scheduled for deletion
A stuff/loot/bloo.h # file is scheduled for addition
C stuff/loot/lump.c # file has textual conflicts from an update
C stuff/loot/glub.c # file has property conflicts from an update
R xyz.c # file is scheduled for replacement
S stuff/squawk # file or dir has been switched to a branch
K dog.jpg # file is locked locally; lock-token present
O cat.jpg # file is locked in the repository by other user
B bird.jpg # file is locked locally, but lock has been broken
T fish.jpg # file is locked locally, but lock has been stolen

Bạn cũng có thể kiểm tra riêng lẻ một tập tin, thư mục bằng cách chỉ rõ đường dẫn tới tập tin bạn muốn kiểm tra

$ svn status stuff/fish.c
D stuff/fish.c

Lệnh svn status chỉ kiểm tra bản làm việc của bạn và so sánh với thông tin lưu trong .svn ở trên máy của bạn, nếu bạn muốn kiểm tra và so sánh với repo thì bạn phải thêm lựa chọn –show-updates (-u)

$ svn status --show-updates --verbose
M * 44 23 sally README
M 44 20 harry bar.c
* 44 35 harry stuff/trout.c
D 44 19 ira stuff/fish.c
A 0 ? ? stuff/things/bloo.h
Status against revision: 46

Nếu có dấu *, điều này có nghĩa là bạn phải chạy lệnh svn update trước khi bạn lưu bản làm việc của bạn vào repo vì bản làm việc hiện tại của bạn cũ hơn bản trên repo.
Chú ý: Nếu bạn đã dùng CVS, lệnh cvs update tương đương với svn status chứ không phải svn update