Skip to content

SVN

Snippets

Diff only properties of a file

PowerShell
svn diff -r 299:300 --depth empty file_or_folder # --depth empty = prop only

Show working copy edits

Bash
svn status -u wc

Delete last revision

This can be used, for example, to fix a broken repo.

In the example below, r385 of repo my-repo will be used.

1. create new repo

Bash
cd c:\path\to\svn\repositories # NOT working copies but the repositories folder
svnadmin create my-repo-TMP

2. dump old repo INTO new repo

Bash
svnadmin dump -r 0:384 my-repo | svnadmin load my-repo-TMP

OR, if it hangs, try this instead

Bash
svnrdump dump http://your-repo/url | svnrdump load http://your-repo-TMP/url

If also this errors out, you might have to create an empty pre-revision repository hook (or with "exit 0" content):

OR, as a last try, dump to a file (> x.dump) THEN load it separately; pay attention to powershell fking up line endings, both in export and import; use cmd instead.

3. (maybe not necessary): set new repo UUID equal to old repo

Bash
svnadmin setuuid my-repo-TMP $(svnlook uuid my-repo)

OR run svnadmin info my-repo and take note of uuid, then run svnadmin setuuid my-repo-TMP <repo-UUID-here>.

4. rename/delete repos

Bash
mv my-repo my-repo-OLD # or just RMove it
mv my-repo-TMP my-repo