SVN - show versioned local files only (command line)?

svn ls will list all files. If you are not seeing all the files that you expect, maybe they are not in the latest revision, in which case specify the revision using --revision, or probably they are within folders and hence you will have to include --recursive.

Otherwise, if you don't want to use svn ls, you will can write a one liner in bash so that you can subtract the output of normal ls and the svn status entries for untracked files.


The best solution is indeed running the command:

svn list --recursive .

However, this is rather slow. I have a large SVN repo with 26559 files of total size 7 GB, and this command takes almost 4 minutes.


Modern SVN client stores information about working copy in sqlite database, so it is rather easy to hack it. Here is a python script which extracts the list of versioned files in less than a second (works on SVN 1.9.5):

import sqlite3
db = sqlite3.connect('.svn/wc.db')
cursor = db.cursor()
cursor.execute("SELECT * FROM NODES")
data = cursor.fetchall()
for row in data:
    filename = row[1]
    if len(filename.strip()) == 0:
        continue
    print(filename)

Of course, this is an unsupported hack, so it can easily break. Most likely changing minor version of SVN WC is enough to break it. Also, I have no idea how this solution interacts with complicated features like externals, some sparse/mixed checkouts, and whatever other crazy things SVN allows.