[svn] What do the result codes in SVN mean?

What do the result codes in SVN mean? I need a quick reference.

This question is related to svn

The answer is

SVN status columns

$ svn status
L index.html

The output of the command is split into six columns, but that is not obvious because sometimes the columns are empty. Perhaps it would have made more sense to indicate the empty columns with dashes, the way ls -l does, instead of nothing. Then, for example, L index.html would look like --L--- index.html, which makes it obvious the only information we have is in the third column the one about locking. Anyway, once you know that it begins to make more sense.

SVN Status first column: A, D, M, R, C, X, I, ?, !, ~

The first column indicates that an item was added, deleted, or otherwise changed.

      No modifications.

 A    Item is scheduled for Addition.

 D    Item is scheduled for Deletion.

 M    Item has been modified.

 R    Item has been replaced in your working copy. This means the file was scheduled for deletion, and then a new file with the same name was scheduled for addition in its place.

 C    The contents (as opposed to the properties) of the item conflict with updates received from the repository.

 X    Item is related to an externals definition.

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

 ?    Item is not under version control.

 !    Item is missing (e.g. you moved or deleted it without using svn). This also indicates that a directory is incomplete (a checkout or update was interrupted).

 ~    Item is versioned as one kind of object (file, directory, link), but has been replaced by different kind of object.

SVN Status second column: M, C

The second column tells the status of a file’s or directory’s properties.

      No modifications.

 M    Properties for this item have been modified.

 C    Properties for this item are in conflict with property updates received from the repository.

SVN Status third column: L

The third column is populated only if the working copy directory is locked (an svn cleanup should normally be enough to clear it out)

      Item is not locked.

 L    Item is locked.

SVN Status fourth column: +

The fourth column is populated only if the item is scheduled for addition-with-history.

      No history scheduled with commit.

 +    History scheduled with commit.

SVN Status fifth column: S

The fifth column is populated only if the item’s working copy is switched relative to its parent

      Item is a child of its parent directory.

 S    Item is switched.

SVN Status sixth column: K, O, T, B

The sixth column is populated with lock information.

      When –show-updates is used, the file is not locked. If –show-updates is not used, this merely means that the file is not locked in this working copy.

 K    File is locked in this working copy.

 O    File is locked either by another user or in another working copy. This only appears 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 only appears 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 only appears when –show-updates is used.

SVN Status seventh column: *

The out-of-date information appears in the seventh column (only if you pass the –show-updates switch). This is something people who are new to SVN expect the command to do, not realizing it only compare the current state of the file with what information it fetched from the server on the last update.

      The item in your working copy is up-to-date.

 *    A newer revision of the item exists on the server.

I usually use svn through a gui, either my IDE or a client. Because of that, I can never remember the codes when I do have to resort to the command line.

I find this cheat sheet a great help: Subversion Cheat Sheet

Also note that a result code in the second column refers to the properties of the file. For example:

U   filename.1
 U  filename.2  
UU  filename.3

filename.1: the file was updated
filename.2: a property or properties on the file (such as svn:keywords) was updated
filename.3: both the file and its properties were updated

Take a look in the Subversion Book reference: "Status of working copy files and directories"

Highly recommended for anyone doing pretty much anything with SVN.

Whenever you don't have access to documentation (SVNBook), type (Linux):

svn help status | grep \'\?\'
svn help status | grep \'\!\'
svn help status | grep \'\YOUR_SYMBOL_HERE\'

or insert the following function in your ~/.bashrc file, like so:

svncode() {
  [ $symbol ] &&  svn help status | grep \'$(echo $symbol)\' || \
  echo "usage: svncode <symbol>"

enter image description here

I want to say something about the "G" status,

G: Changes on the repo were automatically merged into the working copy

I think the above definition is not cleary, it can generate a little confusion, because all files are automatically merged in to working copy, the correct one should be:

U = item (U)pdated to repository version

G = item’s local changes mer(G)ed with repository

C = item’s local changes (C)onflicted with repository

D = item (D)eleted from working copy

A = item (A)dded to working copy

You can always get a list by running:

svn status --help

There is also an 'E' status

E = File existed before update

This can happen if you have manually created a folder that would have been created by performing an update.