public static boolean branchExists ( String branch , String baseUrl ) { CommandLine cmdLine = new CommandLine ( SVN_CMD ) ; cmdLine . addArgument ( CMD_LOG ) ; cmdLine . addArgument ( OPT_XML ) ; addDefaultArguments ( cmdLine , null , null ) ; cmdLine . addArgument ( "-r" ) ; cmdLine . addArgument ( "HEAD:HEAD" ) ; cmdLine . addArgument ( baseUrl + branch ) ; try ( InputStream inStr = ExecutionHelper . getCommandResult ( cmdLine , new File ( "." ) , 0 , 120000 ) ) { return true ; } catch ( IOException e ) { log . log ( Level . FINE , "Branch " + branch + " not found or other error" , e ) ; return false ; } }
Check if the given branch already exists