code: public static void commitMergeInfo(String comment, File directory) throws IOException {
          // all these additional merge-info updates on the sub-directories and items just
          // clobbers the svn history, revert all those and just keep the merge-info on the root-directory
          revertAllButRootDir(directory);
  
          IOException exception = null;
          for (int i = 0; i < COMMIT_RETRY_COUNT; i++) {
              try {
                  // update once more
                  SVNCommands.update(directory);
  
                  // now we can commit the resulting file, alternatively we could also just commit "." here and revert everything else afterwards
                  CommandLine cmdLine = new CommandLine(SVN_CMD);
                  cmdLine.addArgument("commit");
                  addDefaultArguments(cmdLine, null, null);
                  cmdLine.addArgument("-m");
                  cmdLine.addArgument(comment);
                  //cmdLine.addArgument(".");	// current dir
  
                  try (InputStream result = ExecutionHelper.getCommandResult(cmdLine, directory, 0, 120000)) {
                      log.info("Svn-Commit reported:\n" + IOUtils.toString(result, "UTF-8"));
                  }
                  return;
              } catch (IOException e) {
                  // try again if we find the general error message which usually indicates that another
                  // check-in was made in between and we need to re-update once more
                  if (e.getMessage().contains("Process exited with an error: 1 (Exit value: 1)")) {
                      exception = e;
  
                      log.log(Level.WARNING, "Retrying merge info commit as we had an error which usually indicates that another developer checked in something: " + e.getMessage());
                      continue;
                  }
  
                  throw e;
              }
          }
  
          throw exception;
      }
docs: Will commit the merge info on the root branch.
  <p>
  Attention: This will revert all changes on the working copy except the property on the
  root-dir. Be careful to not run this on a working copy with other relevant changes!
  
  @param comment The comment to use for the commit
  @param directory The local working directory
  @throws IOException Execution of the SVN sub-process failed or the
  sub-process returned a exit value indicating a failure