summaryrefslogtreecommitdiff
path: root/tests/fixtures
diff options
context:
space:
mode:
authorQijiang Fan <fqj1994@gmail.com>2012-11-15 17:11:37 +0800
committerQijiang Fan <fqj1994@gmail.com>2012-11-15 17:11:37 +0800
commit206ab31e9e0aae6866a27511724298dd00a7d90e (patch)
tree651928c31b80fee0b7cd4a6213e8c7642e615a7a /tests/fixtures
parent41ab46d551a1287a4dfb60d04e132af468923d95 (diff)
Upstream version 1.5
Diffstat (limited to 'tests/fixtures')
-rw-r--r--tests/fixtures/addspecial.sh51
-rw-r--r--tests/fixtures/addspecial.svndump302
-rwxr-xr-xtests/fixtures/copies.sh29
-rw-r--r--tests/fixtures/copies.svndump158
-rw-r--r--tests/fixtures/correct.svndump103
-rw-r--r--tests/fixtures/corrupt.svndump97
-rwxr-xr-xtests/fixtures/delete_restore_trunk.sh31
-rw-r--r--tests/fixtures/delete_restore_trunk.svndump167
-rwxr-xr-xtests/fixtures/emptyrepo2.sh44
-rw-r--r--tests/fixtures/emptyrepo2.svndump129
-rwxr-xr-xtests/fixtures/invalid_utf8.sh34
-rw-r--r--tests/fixtures/invalid_utf8.tar.gzbin0 -> 8227 bytes
-rwxr-xr-xtests/fixtures/movetotrunk.sh34
-rw-r--r--tests/fixtures/movetotrunk.svndump154
-rwxr-xr-xtests/fixtures/revert.sh39
-rw-r--r--tests/fixtures/revert.svndump197
-rw-r--r--tests/fixtures/subdir_is_file_prefix.svndump72
17 files changed, 1641 insertions, 0 deletions
diff --git a/tests/fixtures/addspecial.sh b/tests/fixtures/addspecial.sh
new file mode 100644
index 0000000..1d242bc
--- /dev/null
+++ b/tests/fixtures/addspecial.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+mkdir temp
+cd temp
+
+svnadmin create repo
+svn co file://`pwd`/repo wc
+cd wc
+
+mkdir -p trunk branches
+svn add trunk branches
+svn ci -m'initial structure'
+cd trunk
+echo a>a
+svn add a
+svn ci -mci1 a
+cd ..
+svn up
+svn cp trunk branches/foo
+svn ci -m'branch foo'
+cd branches/foo
+ln -s a fnord
+svn add fnord
+svn ci -msymlink fnord
+mkdir 'spacy name'
+echo a > 'spacy name/spacy file'
+svn add 'spacy name'
+svn ci -mspacy 'spacy name'
+svn up
+echo b > 'spacy name/surprise ~'
+svn add 'spacy name/surprise ~'
+svn ci -mtilde 'spacy name'
+svn up ../..
+echo foo > exe
+chmod +x exe
+svn add exe
+svn ci -mexecutable exe
+svn up ../..
+cd ../../trunk
+svn merge ../branches/foo
+svn ci -mmerge
+svn up
+
+pwd
+cd ../../..
+svnadmin dump temp/repo > addspecial.svndump
+echo
+echo 'Complete.'
+echo 'You probably want to clean up temp now.'
+echo 'Dump in addspecial.svndump'
+exit 0
diff --git a/tests/fixtures/addspecial.svndump b/tests/fixtures/addspecial.svndump
new file mode 100644
index 0000000..6cc3e4c
--- /dev/null
+++ b/tests/fixtures/addspecial.svndump
@@ -0,0 +1,302 @@
+SVN-fs-dump-format-version: 2
+
+UUID: 01df53ad-5d72-4756-8742-f669dc98f791
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2012-05-13T22:22:43.218190Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 118
+Content-length: 118
+
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-13T22:22:44.112163Z
+K 7
+svn:log
+V 17
+initial structure
+PROPS-END
+
+Node-path: branches
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Revision-number: 2
+Prop-content-length: 103
+Content-length: 103
+
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-13T22:22:45.111247Z
+K 7
+svn:log
+V 3
+ci1
+PROPS-END
+
+Node-path: trunk/a
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 2
+Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3
+Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b
+Content-length: 12
+
+PROPS-END
+a
+
+
+Revision-number: 3
+Prop-content-length: 111
+Content-length: 111
+
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-13T22:22:48.110257Z
+K 7
+svn:log
+V 10
+branch foo
+PROPS-END
+
+Node-path: branches/foo
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 2
+Node-copyfrom-path: trunk
+
+
+Revision-number: 4
+Prop-content-length: 107
+Content-length: 107
+
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-13T22:22:49.115096Z
+K 7
+svn:log
+V 7
+symlink
+PROPS-END
+
+Node-path: branches/foo/fnord
+Node-kind: file
+Node-action: add
+Prop-content-length: 33
+Text-content-length: 6
+Text-content-md5: c118dba188202a1efc975bef6064180b
+Text-content-sha1: 41f94e4692313bf7f7c92aa600002f1dff93d6bf
+Content-length: 39
+
+K 11
+svn:special
+V 1
+*
+PROPS-END
+link a
+
+Revision-number: 5
+Prop-content-length: 105
+Content-length: 105
+
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-13T22:22:50.119266Z
+K 7
+svn:log
+V 5
+spacy
+PROPS-END
+
+Node-path: branches/foo/spacy name
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: branches/foo/spacy name/spacy file
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 2
+Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3
+Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b
+Content-length: 12
+
+PROPS-END
+a
+
+
+Revision-number: 6
+Prop-content-length: 105
+Content-length: 105
+
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-13T22:22:52.123367Z
+K 7
+svn:log
+V 5
+tilde
+PROPS-END
+
+Node-path: branches/foo/spacy name/surprise ~
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 2
+Text-content-md5: 3b5d5c3712955042212316173ccf37be
+Text-content-sha1: 89e6c98d92887913cadf06b2adb97f26cde4849b
+Content-length: 12
+
+PROPS-END
+b
+
+
+Revision-number: 7
+Prop-content-length: 111
+Content-length: 111
+
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-13T22:22:54.129462Z
+K 7
+svn:log
+V 10
+executable
+PROPS-END
+
+Node-path: branches/foo/exe
+Node-kind: file
+Node-action: add
+Prop-content-length: 36
+Text-content-length: 4
+Text-content-md5: d3b07384d113edec49eaa6238ad5ff00
+Text-content-sha1: f1d2d2f924e986ac86fdf7b36c94bcdf32beec15
+Content-length: 40
+
+K 14
+svn:executable
+V 1
+*
+PROPS-END
+foo
+
+
+Revision-number: 8
+Prop-content-length: 105
+Content-length: 105
+
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-13T22:22:57.111370Z
+K 7
+svn:log
+V 5
+merge
+PROPS-END
+
+Node-path: trunk
+Node-kind: dir
+Node-action: change
+Prop-content-length: 52
+Content-length: 52
+
+K 13
+svn:mergeinfo
+V 17
+/branches/foo:3-7
+PROPS-END
+
+
+Node-path: trunk/exe
+Node-kind: file
+Node-action: add
+Node-copyfrom-rev: 7
+Node-copyfrom-path: branches/foo/exe
+Text-copy-source-md5: d3b07384d113edec49eaa6238ad5ff00
+Text-copy-source-sha1: f1d2d2f924e986ac86fdf7b36c94bcdf32beec15
+
+
+Node-path: trunk/fnord
+Node-kind: file
+Node-action: add
+Node-copyfrom-rev: 7
+Node-copyfrom-path: branches/foo/fnord
+Text-copy-source-md5: c118dba188202a1efc975bef6064180b
+Text-copy-source-sha1: 41f94e4692313bf7f7c92aa600002f1dff93d6bf
+
+
+Node-path: trunk/spacy name
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 7
+Node-copyfrom-path: branches/foo/spacy name
+
+
diff --git a/tests/fixtures/copies.sh b/tests/fixtures/copies.sh
new file mode 100755
index 0000000..4709bc9
--- /dev/null
+++ b/tests/fixtures/copies.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# Generate copies.svndump
+#
+
+rm -rf temp
+mkdir temp
+cd temp
+mkdir -p import/trunk/dir
+echo a > import/trunk/dir/a
+
+svnadmin create testrepo
+svnurl=file://`pwd`/testrepo
+svn import import $svnurl -m init
+
+svn co $svnurl project
+cd project
+svn cp trunk/dir trunk/dir2
+echo b >> trunk/dir2/a
+svn ci -m 'copy/edit trunk/dir/a'
+svn up
+svn cp trunk/dir2 trunk/dir3
+svn ci -m 'copy dir2 to dir3'
+svn rm trunk/dir3/a
+svn cp trunk/dir2/a trunk/dir3/a
+svn ci -m 'copy and remove'
+cd ..
+
+svnadmin dump testrepo > ../copies.svndump
diff --git a/tests/fixtures/copies.svndump b/tests/fixtures/copies.svndump
new file mode 100644
index 0000000..76cfd97
--- /dev/null
+++ b/tests/fixtures/copies.svndump
@@ -0,0 +1,158 @@
+SVN-fs-dump-format-version: 2
+
+UUID: 6f377846-a035-4244-a154-e87a9351a653
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2012-10-15T19:02:56.936694Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 105
+Content-length: 105
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-15T19:02:56.958201Z
+K 7
+svn:log
+V 4
+init
+PROPS-END
+
+Node-path: trunk
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk/dir
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk/dir/a
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 2
+Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3
+Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b
+Content-length: 12
+
+PROPS-END
+a
+
+
+Revision-number: 2
+Prop-content-length: 123
+Content-length: 123
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-15T19:02:58.046478Z
+K 7
+svn:log
+V 21
+copy/edit trunk/dir/a
+PROPS-END
+
+Node-path: trunk/dir2
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 1
+Node-copyfrom-path: trunk/dir
+
+
+Node-path: trunk/dir2/a
+Node-kind: file
+Node-action: change
+Text-content-length: 4
+Text-content-md5: dd8c6a395b5dd36c56d23275028f526c
+Text-content-sha1: 05dec960e24d918b8a73a1c53bcbbaac2ee5c2e0
+Content-length: 4
+
+a
+b
+
+
+Revision-number: 3
+Prop-content-length: 119
+Content-length: 119
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-15T19:03:01.045897Z
+K 7
+svn:log
+V 17
+copy dir2 to dir3
+PROPS-END
+
+Node-path: trunk/dir3
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 2
+Node-copyfrom-path: trunk/dir2
+
+
+Revision-number: 4
+Prop-content-length: 117
+Content-length: 117
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-15T19:03:03.046654Z
+K 7
+svn:log
+V 15
+copy and remove
+PROPS-END
+
+Node-path: trunk/dir3/a
+Node-kind: file
+Node-action: delete
+
+Node-path: trunk/dir3/a
+Node-kind: file
+Node-action: add
+Node-copyfrom-rev: 2
+Node-copyfrom-path: trunk/dir2/a
+Text-copy-source-md5: dd8c6a395b5dd36c56d23275028f526c
+Text-copy-source-sha1: 05dec960e24d918b8a73a1c53bcbbaac2ee5c2e0
+
+
+
+
diff --git a/tests/fixtures/correct.svndump b/tests/fixtures/correct.svndump
new file mode 100644
index 0000000..9e24c3c
--- /dev/null
+++ b/tests/fixtures/correct.svndump
@@ -0,0 +1,103 @@
+SVN-fs-dump-format-version: 2
+
+UUID: 00000000-0000-0000-0000-000000000000
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2010-11-30T15:10:25.898546Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 100
+Content-length: 100
+
+K 7
+svn:log
+V 0
+
+K 10
+svn:author
+V 6
+danchr
+K 8
+svn:date
+V 27
+2010-11-30T15:16:01.077550Z
+PROPS-END
+
+Node-path: empty-file
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 0
+Text-content-md5: d41d8cd98f00b204e9800998ecf8427e
+Text-content-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: executable-file
+Node-kind: file
+Node-action: add
+Prop-content-length: 36
+Text-content-length: 11
+Text-content-md5: 01839ba8c81c3b2c7486607e0c683e62
+Text-content-sha1: 5e70f8a25fe8ad4ad971bfd3388c258b019268d4
+Content-length: 47
+
+K 14
+svn:executable
+V 1
+*
+PROPS-END
+Executable
+
+
+Node-path: regular-file
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 10
+Text-content-md5: 2e01b7f4ab0c18c05a3059eb2e2420d9
+Text-content-sha1: 6e530e985be313a43dc9734251656be8f0c94ab8
+Content-length: 20
+
+PROPS-END
+Contents.
+
+
+Node-path: another-regular-file
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 10
+Text-content-md5: 2e01b7f4ab0c18c05a3059eb2e2420d9
+Text-content-sha1: 6e530e985be313a43dc9734251656be8f0c94ab8
+Content-length: 20
+
+PROPS-END
+Contents.
+
+
+Node-path: symlink
+Node-kind: file
+Node-action: add
+Prop-content-length: 33
+Text-content-length: 6
+Text-content-md5: 654580f41818cd6f51408c7cbd313728
+Text-content-sha1: 130b8faaf3e1acc1b95f77ac835e9c8b6eee5c96
+Content-length: 39
+
+K 11
+svn:special
+V 1
+*
+PROPS-END
+link A
+
diff --git a/tests/fixtures/corrupt.svndump b/tests/fixtures/corrupt.svndump
new file mode 100644
index 0000000..bcc0941
--- /dev/null
+++ b/tests/fixtures/corrupt.svndump
@@ -0,0 +1,97 @@
+SVN-fs-dump-format-version: 2
+
+UUID: 00000000-0000-0000-0000-000000000000
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2010-11-30T15:10:25.898546Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 100
+Content-length: 100
+
+K 10
+svn:author
+V 6
+danchr
+K 8
+svn:date
+V 27
+2010-11-30T15:16:01.077550Z
+K 7
+svn:log
+V 0
+
+PROPS-END
+
+Node-path: another-regular-file
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 0
+Text-content-md5: d41d8cd98f00b204e9800998ecf8427e
+Text-content-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: executable-file
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 11
+Text-content-md5: 01839ba8c81c3b2c7486607e0c683e62
+Text-content-sha1: 5e70f8a25fe8ad4ad971bfd3388c258b019268d4
+Content-length: 21
+
+PROPS-END
+Executable
+
+
+Node-path: missing-file
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 0
+Text-content-md5: d41d8cd98f00b204e9800998ecf8427e
+Text-content-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: regular-file
+Node-kind: file
+Node-action: add
+Prop-content-length: 33
+Text-content-length: 18
+Text-content-md5: adf66a0cec83e25644c63f3c3007ae7c
+Text-content-sha1: 047e6e482d0c9cb812f89d18a9f07a43caab76bb
+Content-length: 51
+
+K 11
+svn:special
+V 1
+*
+PROPS-END
+link Bad contents.
+
+Node-path: symlink
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 1
+Text-content-md5: 7fc56270e7a70fa81a5935b72eacbe29
+Text-content-sha1: 6dcd4ce23d88e2ee9568ba546c007c63d9131c1b
+Content-length: 11
+
+PROPS-END
+A
+
diff --git a/tests/fixtures/delete_restore_trunk.sh b/tests/fixtures/delete_restore_trunk.sh
new file mode 100755
index 0000000..340b5ef
--- /dev/null
+++ b/tests/fixtures/delete_restore_trunk.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+set -e
+mkdir temp
+cd temp
+svnadmin create repo
+svn co file://`pwd`/repo wc
+cd wc
+mkdir branches trunk tags
+svn add *
+svn ci -m 'btt'
+echo foo > trunk/foo
+svn add trunk/foo
+svn ci -m 'add file'
+svn up
+svn rm trunk
+svn ci -m 'delete trunk'
+svn up
+cd ..
+svn cp -m 'restore trunk' file://`pwd`/repo/trunk@2 file://`pwd`/repo/trunk
+cd wc
+svn up
+echo bar >> trunk/foo
+svn ci -m 'append to file'
+svn up
+cd ../..
+svnadmin dump temp/repo > delete_restore_trunk.svndump
+echo
+echo 'Complete.'
+echo 'You probably want to clean up temp now.'
+echo 'Dump in branch_delete_parent_dir.svndump'
+exit 0
diff --git a/tests/fixtures/delete_restore_trunk.svndump b/tests/fixtures/delete_restore_trunk.svndump
new file mode 100644
index 0000000..2d95813
--- /dev/null
+++ b/tests/fixtures/delete_restore_trunk.svndump
@@ -0,0 +1,167 @@
+SVN-fs-dump-format-version: 2
+
+UUID: fca176f4-a346-479b-ae2c-78c8442c3809
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2012-05-16T22:55:55.613464Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 103
+Content-length: 103
+
+K 7
+svn:log
+V 3
+btt
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-16T22:55:56.081065Z
+PROPS-END
+
+Node-path: branches
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: tags
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Revision-number: 2
+Prop-content-length: 108
+Content-length: 108
+
+K 7
+svn:log
+V 8
+add file
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-16T22:55:57.071178Z
+PROPS-END
+
+Node-path: trunk/foo
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 4
+Text-content-md5: d3b07384d113edec49eaa6238ad5ff00
+Text-content-sha1: f1d2d2f924e986ac86fdf7b36c94bcdf32beec15
+Content-length: 14
+
+PROPS-END
+foo
+
+
+Revision-number: 3
+Prop-content-length: 113
+Content-length: 113
+
+K 7
+svn:log
+V 12
+delete trunk
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-16T22:55:59.058026Z
+PROPS-END
+
+Node-path: trunk
+Node-action: delete
+
+
+Revision-number: 4
+Prop-content-length: 114
+Content-length: 114
+
+K 7
+svn:log
+V 13
+restore trunk
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-16T22:56:01.055887Z
+PROPS-END
+
+Node-path: trunk
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 2
+Node-copyfrom-path: trunk
+
+
+Revision-number: 5
+Prop-content-length: 115
+Content-length: 115
+
+K 7
+svn:log
+V 14
+append to file
+K 10
+svn:author
+V 6
+bryano
+K 8
+svn:date
+V 27
+2012-05-16T22:56:02.060991Z
+PROPS-END
+
+Node-path: trunk/foo
+Node-kind: file
+Node-action: change
+Text-content-length: 8
+Text-content-md5: f47c75614087a8dd938ba4acff252494
+Text-content-sha1: 4e48e2c9a3d2ca8a708cb0cc545700544efb5021
+Content-length: 8
+
+foo
+bar
+
+
diff --git a/tests/fixtures/emptyrepo2.sh b/tests/fixtures/emptyrepo2.sh
new file mode 100755
index 0000000..a29afdd
--- /dev/null
+++ b/tests/fixtures/emptyrepo2.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# Create emptyrepo2.svndump
+#
+# The generated repository contains a sequence of empty revisions
+# created with a combination of svnsync and filtering
+
+mkdir temp
+cd temp
+
+mkdir project-orig
+cd project-orig
+mkdir -p sub/trunk other
+echo a > other/a
+cd ..
+
+svnadmin create testrepo
+svnurl=file://`pwd`/testrepo
+svn import project-orig $svnurl -m init
+
+svn co $svnurl project
+cd project
+echo a >> other/a
+svn ci -m othera
+echo a >> other/a
+svn ci -m othera2
+echo b > sub/trunk/a
+svn add sub/trunk/a
+svn ci -m adda
+cd ..
+
+svnadmin create testrepo2
+cat > testrepo2/hooks/pre-revprop-change <<EOF
+#!/bin/sh
+exit 0
+EOF
+chmod +x testrepo2/hooks/pre-revprop-change
+
+svnurl2=file://`pwd`/testrepo2
+svnsync init --username svnsync $svnurl2 $svnurl/sub
+svnsync sync $svnurl2
+
+svnadmin dump testrepo2 > ../emptyrepo2.svndump
+
diff --git a/tests/fixtures/emptyrepo2.svndump b/tests/fixtures/emptyrepo2.svndump
new file mode 100644
index 0000000..3f6e553
--- /dev/null
+++ b/tests/fixtures/emptyrepo2.svndump
@@ -0,0 +1,129 @@
+SVN-fs-dump-format-version: 2
+
+UUID: 293d1f29-635d-48b8-9cdf-468fd987067a
+
+Revision-number: 0
+Prop-content-length: 261
+Content-length: 261
+
+K 8
+svn:date
+V 27
+2012-10-03T18:58:42.535317Z
+K 17
+svn:sync-from-url
+V 74
+file:///Users/pmezard/dev/hg/hgsubversion/tests/fixtures/temp/testrepo/sub
+K 18
+svn:sync-from-uuid
+V 36
+241badf9-093f-4e71-8a58-1028abf52758
+K 24
+svn:sync-last-merged-rev
+V 1
+4
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 105
+Content-length: 105
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-03T18:58:42.556405Z
+K 7
+svn:log
+V 4
+init
+PROPS-END
+
+Node-path: sub
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: sub/trunk
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Revision-number: 2
+Prop-content-length: 107
+Content-length: 107
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-03T18:58:43.040912Z
+K 7
+svn:log
+V 6
+othera
+PROPS-END
+
+Revision-number: 3
+Prop-content-length: 108
+Content-length: 108
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-03T18:58:44.042124Z
+K 7
+svn:log
+V 7
+othera2
+PROPS-END
+
+Revision-number: 4
+Prop-content-length: 105
+Content-length: 105
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-03T18:58:45.053459Z
+K 7
+svn:log
+V 4
+adda
+PROPS-END
+
+Node-path: sub/trunk/a
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 2
+Text-content-md5: 3b5d5c3712955042212316173ccf37be
+Text-content-sha1: 89e6c98d92887913cadf06b2adb97f26cde4849b
+Content-length: 12
+
+PROPS-END
+b
+
+
diff --git a/tests/fixtures/invalid_utf8.sh b/tests/fixtures/invalid_utf8.sh
new file mode 100755
index 0000000..76dd9f8
--- /dev/null
+++ b/tests/fixtures/invalid_utf8.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+#-*- coding: utf-8 -*-
+#
+# Generate invalid_utf8.svndump
+#
+
+#check svnadmin version, must be >= 1.7
+SVNVERSION=$(svnadmin --version | head -n 1 | cut -d \ -f 3)
+if [[ "$SVNVERSION" < '1.7' ]] ; then
+ echo "You MUST have svn 1.7 or above to use this script"
+ exit 1
+fi
+
+set -x
+
+TMPDIR=$(mktemp -d)
+WD=$(pwd)
+
+cd $TMPDIR
+
+svnadmin create failrepo
+svn co file://$PWD/failrepo fail
+(
+ cd fail
+ touch A
+ svn add A
+ svn ci -m blabargrod
+)
+svnadmin --pre-1.6-compatible create invalid_utf8
+svnadmin dump failrepo | \
+ sed "s/blabargrod/$(echo blåbærgrød | iconv -f utf-8 -t latin1)/g" | \
+ svnadmin load --bypass-prop-validation invalid_utf8
+
+tar cz -C invalid_utf8 -f "$WD"/invalid_utf8.tar.gz .
diff --git a/tests/fixtures/invalid_utf8.tar.gz b/tests/fixtures/invalid_utf8.tar.gz
new file mode 100644
index 0000000..537021f
--- /dev/null
+++ b/tests/fixtures/invalid_utf8.tar.gz
Binary files differ
diff --git a/tests/fixtures/movetotrunk.sh b/tests/fixtures/movetotrunk.sh
new file mode 100755
index 0000000..b27572c
--- /dev/null
+++ b/tests/fixtures/movetotrunk.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# Generate movetotrunk.svndump
+#
+
+mkdir temp
+cd temp
+
+mkdir project-orig
+cd project-orig
+cd ..
+
+svnadmin create testrepo
+svnurl=file://`pwd`/testrepo
+svn mkdir --parents $svnurl/sub1/sub2 -m subpaths
+svn import project-orig $svnurl/sub1/sub2 -m "init project"
+
+svn co $svnurl/sub1/sub2 project
+cd project
+echo a > a
+svn add a
+mkdir dir
+echo b > dir/b
+svn add dir
+svn ci -m adda
+svn up
+mkdir trunk
+svn add trunk
+svn mv a trunk/a
+svn mv dir trunk/dir
+svn ci -m 'move to trunk'
+cd ..
+
+svnadmin dump testrepo > ../movetotrunk.svndump
diff --git a/tests/fixtures/movetotrunk.svndump b/tests/fixtures/movetotrunk.svndump
new file mode 100644
index 0000000..928a8f3
--- /dev/null
+++ b/tests/fixtures/movetotrunk.svndump
@@ -0,0 +1,154 @@
+SVN-fs-dump-format-version: 2
+
+UUID: bb3f8dfd-83a8-4fe0-b57e-00a3838532ab
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2012-10-20T20:23:15.254324Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 109
+Content-length: 109
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-20T20:23:15.271492Z
+K 7
+svn:log
+V 8
+subpaths
+PROPS-END
+
+Node-path: sub1
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: sub1/sub2
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Revision-number: 2
+Prop-content-length: 105
+Content-length: 105
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-20T20:23:16.068226Z
+K 7
+svn:log
+V 4
+adda
+PROPS-END
+
+Node-path: sub1/sub2/a
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 2
+Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3
+Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b
+Content-length: 12
+
+PROPS-END
+a
+
+
+Node-path: sub1/sub2/dir
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: sub1/sub2/dir/b
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 2
+Text-content-md5: 3b5d5c3712955042212316173ccf37be
+Text-content-sha1: 89e6c98d92887913cadf06b2adb97f26cde4849b
+Content-length: 12
+
+PROPS-END
+b
+
+
+Revision-number: 3
+Prop-content-length: 115
+Content-length: 115
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-20T20:23:20.043626Z
+K 7
+svn:log
+V 13
+move to trunk
+PROPS-END
+
+Node-path: sub1/sub2/trunk
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: sub1/sub2/trunk/a
+Node-kind: file
+Node-action: add
+Node-copyfrom-rev: 2
+Node-copyfrom-path: sub1/sub2/a
+Text-copy-source-md5: 60b725f10c9c85c70d97880dfe8191b3
+Text-copy-source-sha1: 3f786850e387550fdab836ed7e6dc881de23001b
+
+
+Node-path: sub1/sub2/trunk/dir
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 2
+Node-copyfrom-path: sub1/sub2/dir
+
+
+Node-path: sub1/sub2/dir
+Node-action: delete
+
+
+Node-path: sub1/sub2/a
+Node-action: delete
+
+
diff --git a/tests/fixtures/revert.sh b/tests/fixtures/revert.sh
new file mode 100755
index 0000000..aaab485
--- /dev/null
+++ b/tests/fixtures/revert.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Generate revert.svndump
+#
+
+rm -rf temp
+mkdir temp
+cd temp
+mkdir -p import/trunk/dir
+cd import/trunk
+echo a > a
+echo b > dir/b
+cd ../..
+
+svnadmin create testrepo
+svnurl=file://`pwd`/testrepo
+svn import import $svnurl -m init
+
+svn co $svnurl project
+cd project
+echo a >> trunk/a
+echo b >> trunk/dir/b
+svn ci -m changefiles
+svn up
+# Test directory revert
+svn rm trunk
+svn cp $svnurl/trunk@1 trunk
+svn st
+svn ci -m revert
+svn up
+# Test file revert
+svn rm trunk/a
+svn rm trunk/dir/b
+svn cp $svnurl/trunk/a@2 trunk/a
+svn cp $svnurl/trunk/dir/b@2 trunk/dir/b
+svn ci -m revert2
+cd ..
+
+svnadmin dump testrepo > ../revert.svndump
diff --git a/tests/fixtures/revert.svndump b/tests/fixtures/revert.svndump
new file mode 100644
index 0000000..2a368ae
--- /dev/null
+++ b/tests/fixtures/revert.svndump
@@ -0,0 +1,197 @@
+SVN-fs-dump-format-version: 2
+
+UUID: 307f02f4-2d74-44cb-98a4-4e162241d396
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2012-10-06T08:50:46.559327Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 105
+Content-length: 105
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-06T08:50:46.581582Z
+K 7
+svn:log
+V 4
+init
+PROPS-END
+
+Node-path: trunk
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk/a
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 2
+Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3
+Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b
+Content-length: 12
+
+PROPS-END
+a
+
+
+Node-path: trunk/dir
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk/dir/b
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 2
+Text-content-md5: 3b5d5c3712955042212316173ccf37be
+Text-content-sha1: 89e6c98d92887913cadf06b2adb97f26cde4849b
+Content-length: 12
+
+PROPS-END
+b
+
+
+Revision-number: 2
+Prop-content-length: 113
+Content-length: 113
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-06T08:50:47.048033Z
+K 7
+svn:log
+V 11
+changefiles
+PROPS-END
+
+Node-path: trunk/a
+Node-kind: file
+Node-action: change
+Text-content-length: 4
+Text-content-md5: 0d227f1abf8c2932d342e9b99cc957eb
+Text-content-sha1: d7c8127a20a396cff08af086a1c695b0636f0c29
+Content-length: 4
+
+a
+a
+
+
+Node-path: trunk/dir/b
+Node-kind: file
+Node-action: change
+Text-content-length: 4
+Text-content-md5: 06ac26ed8b614fc0b141e4542aa067c2
+Text-content-sha1: f6980469e74f7125178e88ec571e06fe6ce86e95
+Content-length: 4
+
+b
+b
+
+
+Revision-number: 3
+Prop-content-length: 107
+Content-length: 107
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-06T08:50:50.058224Z
+K 7
+svn:log
+V 6
+revert
+PROPS-END
+
+Node-path: trunk
+Node-kind: dir
+Node-action: delete
+
+Node-path: trunk
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 1
+Node-copyfrom-path: trunk
+
+
+
+
+Revision-number: 4
+Prop-content-length: 108
+Content-length: 108
+
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2012-10-06T08:50:54.047396Z
+K 7
+svn:log
+V 7
+revert2
+PROPS-END
+
+Node-path: trunk/a
+Node-kind: file
+Node-action: delete
+
+Node-path: trunk/a
+Node-kind: file
+Node-action: add
+Node-copyfrom-rev: 2
+Node-copyfrom-path: trunk/a
+Text-copy-source-md5: 0d227f1abf8c2932d342e9b99cc957eb
+Text-copy-source-sha1: d7c8127a20a396cff08af086a1c695b0636f0c29
+
+
+
+
+Node-path: trunk/dir/b
+Node-kind: file
+Node-action: delete
+
+Node-path: trunk/dir/b
+Node-kind: file
+Node-action: add
+Node-copyfrom-rev: 2
+Node-copyfrom-path: trunk/dir/b
+Text-copy-source-md5: 06ac26ed8b614fc0b141e4542aa067c2
+Text-copy-source-sha1: f6980469e74f7125178e88ec571e06fe6ce86e95
+
+
+
+
diff --git a/tests/fixtures/subdir_is_file_prefix.svndump b/tests/fixtures/subdir_is_file_prefix.svndump
new file mode 100644
index 0000000..c09b45a
--- /dev/null
+++ b/tests/fixtures/subdir_is_file_prefix.svndump
@@ -0,0 +1,72 @@
+SVN-fs-dump-format-version: 2
+
+UUID: 924a052a-5e5a-4a8e-a677-da5565bec340
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2011-03-04T12:33:29.342045Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 123
+Content-length: 123
+
+K 7
+svn:log
+V 22
+Create directory flaf.
+K 10
+svn:author
+V 6
+danchr
+K 8
+svn:date
+V 27
+2011-03-04T12:34:00.349950Z
+PROPS-END
+
+Node-path: flaf
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Revision-number: 2
+Prop-content-length: 138
+Content-length: 138
+
+K 7
+svn:log
+V 37
+Create the file flaf.txt within flaf.
+K 10
+svn:author
+V 6
+danchr
+K 8
+svn:date
+V 27
+2011-03-04T12:45:01.701033Z
+PROPS-END
+
+Node-path: flaf/flaf.txt
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 15
+Text-content-md5: 8c0059c8f7998e8003836b8e8fcb74d7
+Text-content-sha1: b7d680bc5411f46395c4ef267001e1a307d7b0d5
+Content-length: 25
+
+PROPS-END
+Goodbye world.
+
+