Show only local version (command line) files?

I have a folder with a version under SVN, with a message of 100 files that are not under version control - and about 10.

In svn version 1.6.6, if I type svn status , I get unversioned files with a question mark ? or modified / added M / A files, but I do not see local version files, but have not changed. svn list goes online and retrieves the names of, say, four file versions (but not all ten).

Is there a command that I can use on the command line, so svn lists which files are under version control in this local directory?

Thanks a lot in advance for any answers,
Hurrah!

+7
source share
2 answers

svn ls display all files. If you do not see all the files that you expect, they may not be in the latest version, in which case specify the revision with --revision or maybe they are in folders, and so you will need to include --recursive .

Otherwise, if you do not want to use svn ls , you can write one liner in bash so that you can subtract the output of normal ls and svn status entries for unplayable files.

+13
source

The best solution is to run the command:

 svn list --recursive . 

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


The modern SVN client stores information about the working copy in the sqlite database, so it is quite easy to crack. Here is a Python script that retrieves a list of versioned files in less than a second (runs 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, it’s enough to change the minor version of SVN WC to break it.In addition, I have no idea how this solution interacts with complex functions, such as external functions, some disparate / mixed checks, and everything else that SVN allows.

0
source

Source: https://habr.com/ru/post/900828/


All Articles