Note that there are some explanatory texts on larger screens.

plurals
  1. POsvnkit: How to get exact result of 'svn status' programmatically as String?
    primarykey
    data
    text
    <p>I only found <a href="https://stackoverflow.com/questions/11851584/how-to-list-locally-modified-unversioned-files-using-svnkit">How to list locally-modified/unversioned files using svnkit?</a> which would need complex logic to be implemented to get the exact output of <code>svn status</code> on a root directory of a repository.</p> <p>As svnkit also delivers a command line tool <code>jsvn</code> which is implemented in <code>svnkit-cli</code> I found the code I want to use in <code>org.tmatesoft.svn.cli.svn.SVNStatusCommand.run()</code>.</p> <p>But I can't get it to work and don't find the exact way jsvn is doing it. I would debug jsvn, but cannot get gradle build set up, most probably because of our windows ntlm http proxy here...</p> <p>What I have tried so far:</p> <pre><code>StringBuffer result = new StringBuffer(); SVNStatusCommand svnStatusCall = new SVNStatusCommand(); File statusResult = new File(System.getProperty("java.io.tmpdir") + File.separator + System.currentTimeMillis() + "svnStatusCalls"); PrintStream stream = new PrintStream(statusResult); SVNCommandEnvironment env = new SVNCommandEnvironment("mySvn", stream, stream, null); env.getTargets().add("/home/user/svnroot"); svnStatusCall.init(env); svnStatusCall.run(); stream.flush(); Scanner scanner = new Scanner(statusResult); while (scanner.hasNextLine()) { result.append(scanner.nextLine()); } scanner.close(); </code></pre> <p>This fails due to myTargets of the SVNCommandEnvironment beeing not initialized yet, i.e. being null. The aim is to get the output in a String. I don't like the PrintStream and the extra file in the filesystem, but don't see a different way.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload