Skip to content

Instantly share code, notes, and snippets.

@vs
Created December 11, 2012 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vs/4254718 to your computer and use it in GitHub Desktop.
Save vs/4254718 to your computer and use it in GitHub Desktop.
JavaHL: Creating FSFS repository with a whitespace in its name
final File tmpDir = new File(System.getProperty("java.io.tmpdir", "/tmp"));
final File repoRoot = new File(tmpDir, "repo with space");
final String url = SVNURL.fromFile(repoRoot).toDecodedString();
final File wcRoot = new File(tmpDir, "wc");
SVNAdmin admin = new SVNAdmin();
admin.create(repoRoot.getAbsolutePath(), true, true, null, SVNAdmin.FSFS);
SVNClientInterface client = SVNClientImpl.newInstance();
client.checkout(url,
wcRoot.getAbsolutePath(),
Revision.HEAD, Revision.HEAD, Depth.infinity, true, false);
final File trunk = new File(wcRoot, "trunk");
trunk.mkdir();
client.add(trunk.getAbsolutePath(), Depth.infinity, false, false, false);
client.commit(new String[] {wcRoot.getAbsolutePath()},
"Added trunk, branches and tags",
Depth.infinity, false, false, new String[0], Collections.emptyMap());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment