diff --git a/devops/README.md b/devops/README.md index bbc84af..133fdbf 100644 --- a/devops/README.md +++ b/devops/README.md @@ -3,3 +3,4 @@ DevOps notions, tools and procedures. - [git](git.md) +- [SVN](svn.md) diff --git a/devops/svn.md b/devops/svn.md new file mode 100644 index 0000000..b17008c --- /dev/null +++ b/devops/svn.md @@ -0,0 +1,66 @@ +# 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 + +```shell +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 + +```shell +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 + +```shell +svnadmin dump -r 0:384 my-repo | svnadmin load my-repo-TMP +``` + +OR, if it hangs, try this instead + +```shell +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](https://stackoverflow.com/questions/48371447/piping-text-to-an-external-program-appends-a-trailing-newline), both in export and import; use `cmd` instead. + +#### 3. (maybe not necessary): set new repo UUID equal to old repo + +```shell +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 `. + +#### 4. rename/delete repos + +```shell +mv my-repo my-repo-OLD # or just RMove it +mv my-repo-TMP my-repo +```