#!/bin/sh global test_description := ''check svn dumpfile importer'' source ./test-lib.sh proc reinit_git { if ! test_declared_prereq PIPE { echo >&4 "reinit_git: need to declare PIPE prerequisite> !4 "reinit_git: need to declare PIPE prerequisite" return 127 } rm -fr .git && rm -f stream backflow && git init && mkfifo stream backflow } proc try_dump { global input := $1 && global maybe_fail_svnfe := $(2:+test_$2) && global maybe_fail_fi := $(3:+test_$3) && do { $maybe_fail_svnfe test-svn-fe $input >stream !3 3backflow && wait $BgPid } proc properties { while test "$#" -ne 0 { global property := $1 && global value := $2 && printf "%s\n" "K $(#property)" && printf "%s\n" $property && printf "%s\n" "V $(#value)" && printf "%s\n" $value && shift 2 || return 1 } } proc text_no_props { global text := ""$1 "" && printf "%s\n" "Prop-content-length: 10" && printf "%s\n" "Text-content-length: $(#text)" && printf "%s\n" "Content-length: $(${#text} + 10)" && printf "%s\n" "" "PROPS-END" && printf "%s\n" $text } >empty test_expect_success PIPE 'empty dump' ' reinit_git && echo "SVN-fs-dump-format-version: 2" >input && try_dump input ' test_expect_success PIPE 'v4 dumps not supported' ' reinit_git && echo "SVN-fs-dump-format-version: 4" >v4.dump && try_dump v4.dump must_fail ' test_expect_failure PIPE 'empty revision' ' reinit_git && printf "rev : %s\n" "" "" >expect && cat >emptyrev.dump <<-\EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 Prop-content-length: 0 Content-length: 0 Revision-number: 2 Prop-content-length: 0 Content-length: 0 EOF try_dump emptyrev.dump && git log -p --format="rev <%an, %ae>: %s" HEAD >actual && test_cmp expect actual ' test_expect_success PIPE 'empty properties' ' reinit_git && printf "rev : %s\n" "" "" >expect && cat >emptyprop.dump <<-\EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 Prop-content-length: 10 Content-length: 10 PROPS-END Revision-number: 2 Prop-content-length: 10 Content-length: 10 PROPS-END EOF try_dump emptyprop.dump && git log -p --format="rev <%an, %ae>: %s" HEAD >actual && test_cmp expect actual ' test_expect_success PIPE 'author name and commit message' ' reinit_git && echo "" >expect.author && cat >message <<-\EOF && A concise summary of the change A detailed description of the change, why it is needed, what was broken and why applying this is the best course of action. * file.c Details pertaining to an individual file. EOF { properties \ svn:author author@example.com \ svn:log "$(cat message)" && echo PROPS-END } >props && { echo "SVN-fs-dump-format-version: 3" && echo && echo "Revision-number: 1" && echo Prop-content-length: $(wc -c log.dump && try_dump log.dump && git log -p --format="%B" HEAD >actual.log && git log --format="<%an, %ae>" >actual.author && test_cmp message actual.log && test_cmp expect.author actual.author ' test_expect_success PIPE 'unsupported properties are ignored' ' reinit_git && echo author >expect && cat >extraprop.dump <<-\EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 Prop-content-length: 56 Content-length: 56 K 8 nonsense V 1 y K 10 svn:author V 6 author PROPS-END EOF try_dump extraprop.dump && git log -p --format=%an HEAD >actual && test_cmp expect actual ' test_expect_failure PIPE 'timestamp and empty file' ' echo author@example.com >expect.author && echo 1999-01-01 >expect.date && echo file >expect.files && reinit_git && { properties \ svn:author author@example.com \ svn:date "1999-01-01T00:01:002.000000Z" \ svn:log "add empty file" && echo PROPS-END } >props && { cat <<-EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 EOF echo Prop-content-length: $(wc -c emptyfile.dump && try_dump emptyfile.dump && git log --format=%an HEAD >actual.author && git log --date=short --format=%ad HEAD >actual.date && git ls-tree -r --name-only HEAD >actual.files && test_cmp expect.author actual.author && test_cmp expect.date actual.date && test_cmp expect.files actual.files && git checkout HEAD empty-file && test_cmp empty file ' test_expect_success PIPE 'directory with files' ' reinit_git && printf "%s\n" directory/file1 directory/file2 >expect.files && echo hi >hi && echo hello >hello && { properties \ svn:author author@example.com \ svn:date "1999-02-01T00:01:002.000000Z" \ svn:log "add directory with some files in it" && echo PROPS-END } >props && { cat <<-EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 EOF echo Prop-content-length: $(wc -c directory.dump && try_dump directory.dump && git ls-tree -r --name-only HEAD >actual.files && git checkout HEAD directory && test_cmp expect.files actual.files && test_cmp hello directory/file1 && test_cmp hi directory/file2 ' test_expect_success PIPE 'branch name with backslash' ' reinit_git && sort <<-\EOF >expect.branch-files && trunk/file1 trunk/file2 "branches/UpdateFOPto094\\/file1" "branches/UpdateFOPto094\\/file2" EOF echo hi >hi && echo hello >hello && { properties \ svn:author author@example.com \ svn:date "1999-02-02T00:01:02.000000Z" \ svn:log "add directory with some files in it" && echo PROPS-END } >props.setup && { properties \ svn:author brancher@example.com \ svn:date "2007-12-06T21:38:34.000000Z" \ svn:log "Updating fop to .94 and adjust fo-stylesheets" && echo PROPS-END } >props.branch && { cat <<-EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 EOF echo Prop-content-length: $(wc -c branch.dump && try_dump branch.dump && git ls-tree -r --name-only HEAD | sort >actual.branch-files && test_cmp expect.branch-files actual.branch-files ' test_expect_success PIPE 'node without action' ' reinit_git && cat >inaction.dump <<-\EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: directory Node-kind: dir Prop-content-length: 10 Content-length: 10 PROPS-END EOF try_dump inaction.dump must_fail ' test_expect_success PIPE 'action: add node without text' ' reinit_git && cat >textless.dump <<-\EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: textless Node-kind: file Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END EOF try_dump textless.dump must_fail ' test_expect_failure PIPE 'change file mode but keep old content' ' reinit_git && cat >expect <<-\EOF && OBJID :120000 100644 OBJID OBJID T greeting OBJID :100644 120000 OBJID OBJID T greeting OBJID :000000 100644 OBJID OBJID A greeting EOF echo "link hello" >expect.blob && echo hello >hello && cat >filemode.dump <<-\EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: greeting Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 11 Content-length: 21 PROPS-END link hello Revision-number: 2 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: greeting Node-kind: file Node-action: change Prop-content-length: 33 Content-length: 33 K 11 svn:special V 1 * PROPS-END Revision-number: 3 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: greeting Node-kind: file Node-action: change Prop-content-length: 10 Content-length: 10 PROPS-END EOF try_dump filemode.dump && { git rev-list HEAD | git diff-tree --root --stdin | sed "s/$_x40/OBJID/g" } >actual && git show HEAD:greeting >actual.blob && git show HEAD^:greeting >actual.target && test_cmp expect actual && test_cmp expect.blob actual.blob && test_cmp hello actual.target ' test_expect_success PIPE 'NUL in property value' ' reinit_git && echo "commit message" >expect.message && { properties \ unimportant "something with a NUL (Q)" \ svn:log "commit message"&& echo PROPS-END } | q_to_nul >props && { cat <<-\EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 EOF echo Prop-content-length: $(wc -c nulprop.dump && try_dump nulprop.dump && git diff-tree --always -s --format=%s HEAD >actual.message && test_cmp expect.message actual.message ' test_expect_success PIPE 'NUL in log message, file content, and property name' ' # Caveat: svnadmin 1.6.16 (r1073529) truncates at \0 in the # svn:specialQnotreally example. reinit_git && cat >expect <<-\EOF && OBJID :100644 100644 OBJID OBJID M greeting OBJID :000000 100644 OBJID OBJID A greeting EOF printf "\n%s\n" "something with an ASCII NUL (Q)" >expect.message && printf "%s\n" "helQo" >expect.hello1 && printf "%s\n" "link hello" >expect.hello2 && { properties svn:log "something with an ASCII NUL (Q)" && echo PROPS-END } | q_to_nul >props && { q_to_nul <<-\EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: greeting Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 6 Content-length: 16 PROPS-END helQo Revision-number: 2 EOF echo Prop-content-length: $(wc -c 8bitclean.dump && try_dump 8bitclean.dump && { git rev-list HEAD | git diff-tree --root --stdin | sed "s/$_x40/OBJID/g" } >actual && { git cat-file commit HEAD | nul_to_q && echo } | sed -ne "/^\$/,\$ p" >actual.message && git cat-file blob HEAD^:greeting | nul_to_q >actual.hello1 && git cat-file blob HEAD:greeting | nul_to_q >actual.hello2 && test_cmp expect actual && test_cmp expect.message actual.message && test_cmp expect.hello1 actual.hello1 && test_cmp expect.hello2 actual.hello2 ' test_expect_success PIPE 'change file mode and reiterate content' ' reinit_git && cat >expect <<-\EOF && OBJID :120000 100644 OBJID OBJID T greeting OBJID :100644 120000 OBJID OBJID T greeting OBJID :000000 100644 OBJID OBJID A greeting EOF echo "link hello" >expect.blob && echo hello >hello && cat >filemode2.dump <<-\EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: greeting Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 11 Content-length: 21 PROPS-END link hello Revision-number: 2 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: greeting Node-kind: file Node-action: change Prop-content-length: 33 Text-content-length: 11 Content-length: 44 K 11 svn:special V 1 * PROPS-END link hello Revision-number: 3 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: greeting Node-kind: file Node-action: change Prop-content-length: 10 Text-content-length: 11 Content-length: 21 PROPS-END link hello EOF try_dump filemode2.dump && { git rev-list HEAD | git diff-tree --root --stdin | sed "s/$_x40/OBJID/g" } >actual && git show HEAD:greeting >actual.blob && git show HEAD^:greeting >actual.target && test_cmp expect actual && test_cmp expect.blob actual.blob && test_cmp hello actual.target ' test_expect_success PIPE 'deltas supported' ' reinit_git && { # (old) h + (inline) ello + (old) \n printf "SVNQ%b%b%s" "Q\003\006\005\004" "\001Q\0204\001\002" "ello" | q_to_nul } >delta && { properties \ svn:author author@example.com \ svn:date "1999-01-05T00:01:002.000000Z" \ svn:log "add greeting" && echo PROPS-END } >props && { properties \ svn:author author@example.com \ svn:date "1999-01-06T00:01:002.000000Z" \ svn:log "change it" && echo PROPS-END } >props2 && { echo SVN-fs-dump-format-version: 3 && echo && echo Revision-number: 1 && echo Prop-content-length: $(wc -c delta.dump && try_dump delta.dump ' test_expect_success PIPE 'property deltas supported' ' reinit_git && cat >expect <<-\EOF && OBJID :100755 100644 OBJID OBJID M script.sh EOF { properties \ svn:author author@example.com \ svn:date "1999-03-06T00:01:002.000000Z" \ svn:log "make an executable, or chmod -x it" && echo PROPS-END } >revprops && { echo SVN-fs-dump-format-version: 3 && echo && echo Revision-number: 1 && echo Prop-content-length: $(wc -c propdelta.dump && try_dump propdelta.dump && { git rev-list HEAD | git diff-tree --stdin | sed "s/$_x40/OBJID/g" } >actual && test_cmp expect actual ' test_expect_success PIPE 'properties on /' ' reinit_git && cat <<-\EOF >expect && OBJID OBJID :000000 100644 OBJID OBJID A greeting EOF sed -e "s/X$//" <<-\EOF >changeroot.dump && SVN-fs-dump-format-version: 3 Revision-number: 1 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: greeting Node-kind: file Node-action: add Text-content-length: 0 Prop-content-length: 10 Content-length: 10 PROPS-END Revision-number: 2 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: X Node-kind: dir Node-action: change Prop-delta: true Prop-content-length: 43 Content-length: 43 K 10 svn:ignore V 11 build-area PROPS-END EOF try_dump changeroot.dump && { git rev-list HEAD | git diff-tree --root --always --stdin | sed "s/$_x40/OBJID/g" } >actual && test_cmp expect actual ' test_expect_success PIPE 'deltas for typechange' ' reinit_git && cat >expect <<-\EOF && OBJID :120000 100644 OBJID OBJID T test-file OBJID :100755 120000 OBJID OBJID T test-file OBJID :000000 100755 OBJID OBJID A test-file EOF cat >deleteprop.dump <<-\EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: test-file Node-kind: file Node-action: add Prop-delta: true Prop-content-length: 35 Text-content-length: 17 Content-length: 52 K 14 svn:executable V 0 PROPS-END link testing 123 Revision-number: 2 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: test-file Node-kind: file Node-action: change Prop-delta: true Prop-content-length: 53 Text-content-length: 17 Content-length: 70 K 11 svn:special V 1 * D 14 svn:executable PROPS-END link testing 231 Revision-number: 3 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: test-file Node-kind: file Node-action: change Prop-delta: true Prop-content-length: 27 Text-content-length: 17 Content-length: 44 D 11 svn:special PROPS-END link testing 321 EOF try_dump deleteprop.dump && { git rev-list HEAD | git diff-tree --root --stdin | sed "s/$_x40/OBJID/g" } >actual && test_cmp expect actual ' test_expect_success PIPE 'deltas need not consume the whole preimage' ' reinit_git && cat >expect <<-\EOF && OBJID :120000 100644 OBJID OBJID T postimage OBJID :100644 120000 OBJID OBJID T postimage OBJID :000000 100644 OBJID OBJID A postimage EOF echo "first preimage" >expect.1 && printf target >expect.2 && printf lnk >expect.3 && { printf "SVNQ%b%b%b" "QQ\017\001\017" "\0217" "first preimage\n" | q_to_nul } >delta.1 && { properties svn:special "*" && echo PROPS-END } >symlink.props && { printf "SVNQ%b%b%b" "Q\002\013\004\012" "\0201\001\001\0211" "lnk target" | q_to_nul } >delta.2 && { printf "SVNQ%b%b" "Q\004\003\004Q" "\001Q\002\002" | q_to_nul } >delta.3 && { cat <<-\EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: postimage Node-kind: file Node-action: add Text-delta: true Prop-content-length: 10 EOF echo Text-content-length: $(wc -c deltapartial.dump && try_dump deltapartial.dump && { git rev-list HEAD | git diff-tree --root --stdin | sed "s/$_x40/OBJID/g" } >actual && test_cmp expect actual && git show HEAD:postimage >actual.3 && git show HEAD^:postimage >actual.2 && git show HEAD^^:postimage >actual.1 && test_cmp expect.1 actual.1 && test_cmp expect.2 actual.2 && test_cmp expect.3 actual.3 ' test_expect_success PIPE 'no hang for delta trying to read past end of preimage' ' reinit_git && { # COPY 1 printf "SVNQ%b%b" "Q\001\001\002Q" "\001Q" | q_to_nul } >greedy.delta && { cat <<-\EOF && SVN-fs-dump-format-version: 3 Revision-number: 1 Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: bootstrap Node-kind: file Node-action: add Text-delta: true Prop-content-length: 10 EOF echo Text-content-length: $(wc -c greedydelta.dump && try_dump greedydelta.dump must_fail might_fail ' test_expect_success 'set up svn repo' ' svnconf=$PWD/svnconf && mkdir -p "$svnconf" && if svnadmin -h >/dev/null 2>&1 && svnadmin create simple-svn && svnadmin load simple-svn <"$TEST_DIRECTORY/t9135/svn.dump" && svn export --config-dir "$svnconf" "file://$PWD/simple-svn" simple-svnco then test_set_prereq SVNREPO fi ' test_expect_success SVNREPO,PIPE 't9135/svn.dump' ' mkdir -p simple-git && ( cd simple-git && reinit_git && try_dump "$TEST_DIRECTORY/t9135/svn.dump" ) && ( cd simple-svnco && git init && git add . && git fetch ../simple-git master && git diff --exit-code FETCH_HEAD ) ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"check svn dumpfile importer">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (FuncDef name: reinit_git body: (BraceGroup children: [ (If arms: [ (if_arm cond: [(Pipeline children:[(C {(test_declared_prereq)} {(PIPE)})] negated:True)] action: [ (SimpleCommand words: [{(echo)} {(DQ ("reinit_git: need to declare PIPE prerequisite"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(4)} spids:[37])] ) (ControlFlow token: arg_word: {(127)} ) ] spids: [-1 32] ) ] spids: [-1 50] ) (AndOr children: [ (C {(rm)} {(-fr)} {(.git)}) (AndOr children: [ (C {(rm)} {(-f)} {(stream)} {(backflow)}) (AndOr children: [(C {(git)} {(init)}) (C {(mkfifo)} {(stream)} {(backflow)})] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] spids: [20] ) spids: [15 19] ) (FuncDef name: try_dump body: (BraceGroup children: [ (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:input) op: Equal rhs: {($ VSub_Number "$1")} spids: [97] ) ] spids: [97] ) (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:maybe_fail_svnfe) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id: VTest_ColonPlus arg_word: {(test_) ($ VSub_Number "$2")} ) spids: [104 109] ) } spids: [103] ) ] spids: [103] ) (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:maybe_fail_fi) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id: VTest_ColonPlus arg_word: {(test_) ($ VSub_Number "$3")} ) spids: [115 120] ) } spids: [114] ) ] spids: [114] ) (AndOr children: [ (BraceGroup children: [ (Sentence child: (SimpleCommand words: [ {($ VSub_Name "$maybe_fail_svnfe")} {(test-svn-fe)} {(DQ ($ VSub_Name "$input"))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(stream)} spids: [137] ) (Redir op_id: Redir_Less fd: 3 arg_word: {(backflow)} spids: [140] ) ] ) terminator: ) ] spids: [126] ) (AndOr children: [ (SimpleCommand words: [ {($ VSub_Name "$maybe_fail_fi")} {(git)} {(fast-import)} {(--cat-blob-fd) (Lit_Other "=") (3)} ] redirects: [ (Redir op_id: Redir_Less fd: -1 arg_word: {(stream)} spids: [161] ) (Redir op_id: Redir_Great fd: 3 arg_word: {(backflow)} spids: [164] ) ] ) (C {(wait)} {($ VSub_Bang "$!")}) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] spids: [94] ) spids: [89 93] ) (FuncDef name: properties body: (BraceGroup children: [ (While cond: [(C {(test)} {(DQ ($ VSub_Pound "$#"))} {(-ne)} {(0)})] body: (DoGroup children: [ (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:property) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [201] ) ] spids: [201] ) (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:value) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [209] ) ] spids: [209] ) (AndOr children: [ (C {(printf)} {(DQ ("%s") (EscapedLiteralPart token:))} {(DQ ("K ") (BracedVarSub token: prefix_op:VSub_Pound spids:[226229]))} ) (AndOr children: [ (C {(printf)} {(DQ ("%s") (EscapedLiteralPart token:))} {(DQ ($ VSub_Name "$property"))} ) (AndOr children: [ (C {(printf)} { (DQ ("%s") (EscapedLiteralPart token: ) ) } {(DQ ("V ") (BracedVarSub token: prefix_op:VSub_Pound spids:[258261]))} ) (AndOr children: [ (C {(printf)} { (DQ ("%s") (EscapedLiteralPart token: ) ) } {(DQ ($ VSub_Name "$value"))} ) (AndOr children: [ (C {(shift)} {(2)}) (ControlFlow token: arg_word: {(1)} ) ] op_id: Op_DPipe ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] spids: [198 293] ) ) ] spids: [182] ) spids: [177 181] ) (FuncDef name: text_no_props body: (BraceGroup children: [ (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:text) op: Equal rhs: {(DQ ($ VSub_Number "$1") ("\n"))} spids: [306] ) ] spids: [306] ) (AndOr children: [ (C {(printf)} {(DQ ("%s") (EscapedLiteralPart token:))} {(DQ ("Prop-content-length: 10"))} ) (AndOr children: [ (C {(printf)} {(DQ ("%s") (EscapedLiteralPart token:))} { (DQ ("Text-content-length: ") (BracedVarSub token: prefix_op: VSub_Pound spids: [338 341] ) ) } ) (AndOr children: [ (C {(printf)} {(DQ ("%s") (EscapedLiteralPart token:))} { (DQ ("Content-length: ") (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w: { (BracedVarSub token: prefix_op: VSub_Pound spids: [357 360] ) } ) right: (ArithWord w:{(Lit_Digits 10)}) ) spids: [356 366] ) ) } ) (AndOr children: [ (C {(printf)} {(DQ ("%s") (EscapedLiteralPart token:))} {(DQ )} {(DQ (PROPS-END))} ) (C {(printf)} {(DQ ("%s") (EscapedLiteralPart token:))} {(DQ ($ VSub_Name "$text"))} ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] spids: [303] ) spids: [298 302] ) (SimpleCommand redirects:[(Redir op_id:Redir_Great fd:-1 arg_word:{(empty)} spids:[403])]) (C {(test_expect_success)} {(PIPE)} {(SQ <"empty dump">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\techo \"SVN-fs-dump-format-version: 2\" >input &&\n"> <"\ttry_dump input\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"v4 dumps not supported">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\techo \"SVN-fs-dump-format-version: 4\" >v4.dump &&\n"> <"\ttry_dump v4.dump must_fail\n"> ) } ) (C {(test_expect_failure)} {(PIPE)} {(SQ <"empty revision">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\tprintf \"rev : %s\\n\" \"\" \"\" >expect &&\n"> <"\tcat >emptyrev.dump <<-\\EOF &&\n"> <"\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\tRevision-number: 1\n"> <"\tProp-content-length: 0\n"> <"\tContent-length: 0\n"> <"\n"> <"\tRevision-number: 2\n"> <"\tProp-content-length: 0\n"> <"\tContent-length: 0\n"> <"\n"> <"\tEOF\n"> <"\ttry_dump emptyrev.dump &&\n"> <"\tgit log -p --format=\"rev <%an, %ae>: %s\" HEAD >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"empty properties">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\tprintf \"rev : %s\\n\" \"\" \"\" >expect &&\n"> <"\tcat >emptyprop.dump <<-\\EOF &&\n"> <"\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\tRevision-number: 1\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tRevision-number: 2\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\tEOF\n"> <"\ttry_dump emptyprop.dump &&\n"> <"\tgit log -p --format=\"rev <%an, %ae>: %s\" HEAD >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"author name and commit message">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\techo \"\" >expect.author &&\n"> <"\tcat >message <<-\\EOF &&\n"> <"\tA concise summary of the change\n"> <"\n"> <"\tA detailed description of the change, why it is needed, what\n"> <"\twas broken and why applying this is the best course of action.\n"> <"\n"> <"\t* file.c\n"> <"\t Details pertaining to an individual file.\n"> <"\tEOF\n"> <"\t{\n"> <"\t\tproperties \\\n"> <"\t\t\tsvn:author author@example.com \\\n"> <"\t\t\tsvn:log \"$(cat message)\" &&\n"> <"\t\techo PROPS-END\n"> <"\t} >props &&\n"> <"\t{\n"> <"\t\techo \"SVN-fs-dump-format-version: 3\" &&\n"> <"\t\techo &&\n"> <"\t\techo \"Revision-number: 1\" &&\n"> <"\t\techo Prop-content-length: $(wc -c <"\t\techo Content-length: $(wc -c <"\t\techo &&\n"> <"\t\tcat props\n"> <"\t} >log.dump &&\n"> <"\ttry_dump log.dump &&\n"> <"\tgit log -p --format=\"%B\" HEAD >actual.log &&\n"> <"\tgit log --format=\"<%an, %ae>\" >actual.author &&\n"> <"\ttest_cmp message actual.log &&\n"> <"\ttest_cmp expect.author actual.author\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"unsupported properties are ignored">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\techo author >expect &&\n"> <"\tcat >extraprop.dump <<-\\EOF &&\n"> <"\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\tRevision-number: 1\n"> <"\tProp-content-length: 56\n"> <"\tContent-length: 56\n"> <"\n"> <"\tK 8\n"> <"\tnonsense\n"> <"\tV 1\n"> <"\ty\n"> <"\tK 10\n"> <"\tsvn:author\n"> <"\tV 6\n"> <"\tauthor\n"> <"\tPROPS-END\n"> <"\tEOF\n"> <"\ttry_dump extraprop.dump &&\n"> <"\tgit log -p --format=%an HEAD >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(test_expect_failure)} {(PIPE)} {(SQ <"timestamp and empty file">)} { (SQ <"\n"> <"\techo author@example.com >expect.author &&\n"> <"\techo 1999-01-01 >expect.date &&\n"> <"\techo file >expect.files &&\n"> <"\treinit_git &&\n"> <"\t{\n"> <"\t\tproperties \\\n"> <"\t\t\tsvn:author author@example.com \\\n"> <"\t\t\tsvn:date \"1999-01-01T00:01:002.000000Z\" \\\n"> <"\t\t\tsvn:log \"add empty file\" &&\n"> <"\t\techo PROPS-END\n"> <"\t} >props &&\n"> <"\t{\n"> <"\t\tcat <<-EOF &&\n"> <"\t\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\t\tRevision-number: 1\n"> <"\t\tEOF\n"> <"\t\techo Prop-content-length: $(wc -c <"\t\techo Content-length: $(wc -c <"\t\techo &&\n"> <"\t\tcat props &&\n"> <"\t\tcat <<-\\EOF\n"> <"\n"> <"\t\tNode-path: empty-file\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: add\n"> <"\t\tContent-length: 0\n"> <"\n"> <"\t\tEOF\n"> <"\t} >emptyfile.dump &&\n"> <"\ttry_dump emptyfile.dump &&\n"> <"\tgit log --format=%an HEAD >actual.author &&\n"> <"\tgit log --date=short --format=%ad HEAD >actual.date &&\n"> <"\tgit ls-tree -r --name-only HEAD >actual.files &&\n"> <"\ttest_cmp expect.author actual.author &&\n"> <"\ttest_cmp expect.date actual.date &&\n"> <"\ttest_cmp expect.files actual.files &&\n"> <"\tgit checkout HEAD empty-file &&\n"> <"\ttest_cmp empty file\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"directory with files">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\tprintf \"%s\\n\" directory/file1 directory/file2 >expect.files &&\n"> <"\techo hi >hi &&\n"> <"\techo hello >hello &&\n"> <"\t{\n"> <"\t\tproperties \\\n"> <"\t\t\tsvn:author author@example.com \\\n"> <"\t\t\tsvn:date \"1999-02-01T00:01:002.000000Z\" \\\n"> <"\t\t\tsvn:log \"add directory with some files in it\" &&\n"> <"\t\techo PROPS-END\n"> <"\t} >props &&\n"> <"\t{\n"> <"\t\tcat <<-EOF &&\n"> <"\t\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\t\tRevision-number: 1\n"> <"\t\tEOF\n"> <"\t\techo Prop-content-length: $(wc -c <"\t\techo Content-length: $(wc -c <"\t\techo &&\n"> <"\t\tcat props &&\n"> <"\t\tcat <<-\\EOF &&\n"> <"\n"> <"\t\tNode-path: directory\n"> <"\t\tNode-kind: dir\n"> <"\t\tNode-action: add\n"> <"\t\tProp-content-length: 10\n"> <"\t\tContent-length: 10\n"> <"\n"> <"\t\tPROPS-END\n"> <"\n"> <"\t\tNode-path: directory/file1\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: add\n"> <"\t\tEOF\n"> <"\t\ttext_no_props hello &&\n"> <"\t\tcat <<-\\EOF &&\n"> <"\t\tNode-path: directory/file2\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: add\n"> <"\t\tEOF\n"> <"\t\ttext_no_props hi\n"> <"\t} >directory.dump &&\n"> <"\ttry_dump directory.dump &&\n"> <"\n"> <"\tgit ls-tree -r --name-only HEAD >actual.files &&\n"> <"\tgit checkout HEAD directory &&\n"> <"\ttest_cmp expect.files actual.files &&\n"> <"\ttest_cmp hello directory/file1 &&\n"> <"\ttest_cmp hi directory/file2\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"branch name with backslash">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\tsort <<-\\EOF >expect.branch-files &&\n"> <"\ttrunk/file1\n"> <"\ttrunk/file2\n"> <"\t\"branches/UpdateFOPto094\\\\/file1\"\n"> <"\t\"branches/UpdateFOPto094\\\\/file2\"\n"> <"\tEOF\n"> <"\n"> <"\techo hi >hi &&\n"> <"\techo hello >hello &&\n"> <"\t{\n"> <"\t\tproperties \\\n"> <"\t\t\tsvn:author author@example.com \\\n"> <"\t\t\tsvn:date \"1999-02-02T00:01:02.000000Z\" \\\n"> <"\t\t\tsvn:log \"add directory with some files in it\" &&\n"> <"\t\techo PROPS-END\n"> <"\t} >props.setup &&\n"> <"\t{\n"> <"\t\tproperties \\\n"> <"\t\t\tsvn:author brancher@example.com \\\n"> <"\t\t\tsvn:date \"2007-12-06T21:38:34.000000Z\" \\\n"> <"\t\t\tsvn:log \"Updating fop to .94 and adjust fo-stylesheets\" &&\n"> <"\t\techo PROPS-END\n"> <"\t} >props.branch &&\n"> <"\t{\n"> <"\t\tcat <<-EOF &&\n"> <"\t\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\t\tRevision-number: 1\n"> <"\t\tEOF\n"> <"\t\techo Prop-content-length: $(wc -c <"\t\techo Content-length: $(wc -c <"\t\techo &&\n"> <"\t\tcat props.setup &&\n"> <"\t\tcat <<-\\EOF &&\n"> <"\n"> <"\t\tNode-path: trunk\n"> <"\t\tNode-kind: dir\n"> <"\t\tNode-action: add\n"> <"\t\tProp-content-length: 10\n"> <"\t\tContent-length: 10\n"> <"\n"> <"\t\tPROPS-END\n"> <"\n"> <"\t\tNode-path: branches\n"> <"\t\tNode-kind: dir\n"> <"\t\tNode-action: add\n"> <"\t\tProp-content-length: 10\n"> <"\t\tContent-length: 10\n"> <"\n"> <"\t\tPROPS-END\n"> <"\n"> <"\t\tNode-path: trunk/file1\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: add\n"> <"\t\tEOF\n"> <"\t\ttext_no_props hello &&\n"> <"\t\tcat <<-\\EOF &&\n"> <"\t\tNode-path: trunk/file2\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: add\n"> <"\t\tEOF\n"> <"\t\ttext_no_props hi &&\n"> <"\t\tcat <<-\\EOF &&\n"> <"\n"> <"\t\tRevision-number: 2\n"> <"\t\tEOF\n"> <"\t\techo Prop-content-length: $(wc -c <"\t\techo Content-length: $(wc -c <"\t\techo &&\n"> <"\t\tcat props.branch &&\n"> <"\t\tcat <<-\\EOF\n"> <"\n"> <"\t\tNode-path: branches/UpdateFOPto094\\\n"> <"\t\tNode-kind: dir\n"> <"\t\tNode-action: add\n"> <"\t\tNode-copyfrom-rev: 1\n"> <"\t\tNode-copyfrom-path: trunk\n"> <"\n"> <"\t\tNode-kind: dir\n"> <"\t\tNode-action: add\n"> <"\t\tProp-content-length: 34\n"> <"\t\tContent-length: 34\n"> <"\n"> <"\t\tK 13\n"> <"\t\tsvn:mergeinfo\n"> <"\t\tV 0\n"> <"\n"> <"\t\tPROPS-END\n"> <"\t\tEOF\n"> <"\t} >branch.dump &&\n"> <"\ttry_dump branch.dump &&\n"> <"\n"> <"\tgit ls-tree -r --name-only HEAD |\n"> <"\tsort >actual.branch-files &&\n"> <"\ttest_cmp expect.branch-files actual.branch-files\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"node without action">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\tcat >inaction.dump <<-\\EOF &&\n"> <"\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\tRevision-number: 1\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: directory\n"> <"\tNode-kind: dir\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\tEOF\n"> <"\ttry_dump inaction.dump must_fail\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"action: add node without text">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\tcat >textless.dump <<-\\EOF &&\n"> <"\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\tRevision-number: 1\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: textless\n"> <"\tNode-kind: file\n"> <"\tNode-action: add\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\tEOF\n"> <"\ttry_dump textless.dump must_fail\n"> ) } ) (C {(test_expect_failure)} {(PIPE)} {(SQ <"change file mode but keep old content">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\tcat >expect <<-\\EOF &&\n"> <"\tOBJID\n"> <"\t:120000 100644 OBJID OBJID T\tgreeting\n"> <"\tOBJID\n"> <"\t:100644 120000 OBJID OBJID T\tgreeting\n"> <"\tOBJID\n"> <"\t:000000 100644 OBJID OBJID A\tgreeting\n"> <"\tEOF\n"> <"\techo \"link hello\" >expect.blob &&\n"> <"\techo hello >hello &&\n"> <"\tcat >filemode.dump <<-\\EOF &&\n"> <"\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\tRevision-number: 1\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: greeting\n"> <"\tNode-kind: file\n"> <"\tNode-action: add\n"> <"\tProp-content-length: 10\n"> <"\tText-content-length: 11\n"> <"\tContent-length: 21\n"> <"\n"> <"\tPROPS-END\n"> <"\tlink hello\n"> <"\n"> <"\tRevision-number: 2\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: greeting\n"> <"\tNode-kind: file\n"> <"\tNode-action: change\n"> <"\tProp-content-length: 33\n"> <"\tContent-length: 33\n"> <"\n"> <"\tK 11\n"> <"\tsvn:special\n"> <"\tV 1\n"> <"\t*\n"> <"\tPROPS-END\n"> <"\n"> <"\tRevision-number: 3\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: greeting\n"> <"\tNode-kind: file\n"> <"\tNode-action: change\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\tEOF\n"> <"\ttry_dump filemode.dump &&\n"> <"\t{\n"> <"\t\tgit rev-list HEAD |\n"> <"\t\tgit diff-tree --root --stdin |\n"> <"\t\tsed \"s/$_x40/OBJID/g\"\n"> <"\t} >actual &&\n"> <"\tgit show HEAD:greeting >actual.blob &&\n"> <"\tgit show HEAD^:greeting >actual.target &&\n"> <"\ttest_cmp expect actual &&\n"> <"\ttest_cmp expect.blob actual.blob &&\n"> <"\ttest_cmp hello actual.target\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"NUL in property value">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\techo \"commit message\" >expect.message &&\n"> <"\t{\n"> <"\t\tproperties \\\n"> <"\t\t\tunimportant \"something with a NUL (Q)\" \\\n"> <"\t\t\tsvn:log \"commit message\"&&\n"> <"\t\techo PROPS-END\n"> <"\t} |\n"> <"\tq_to_nul >props &&\n"> <"\t{\n"> <"\t\tcat <<-\\EOF &&\n"> <"\t\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\t\tRevision-number: 1\n"> <"\t\tEOF\n"> <"\t\techo Prop-content-length: $(wc -c <"\t\techo Content-length: $(wc -c <"\t\techo &&\n"> <"\t\tcat props\n"> <"\t} >nulprop.dump &&\n"> <"\ttry_dump nulprop.dump &&\n"> <"\tgit diff-tree --always -s --format=%s HEAD >actual.message &&\n"> <"\ttest_cmp expect.message actual.message\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"NUL in log message, file content, and property name">)} { (SQ <"\n"> <"\t# Caveat: svnadmin 1.6.16 (r1073529) truncates at \\0 in the\n"> <"\t# svn:specialQnotreally example.\n"> <"\treinit_git &&\n"> <"\tcat >expect <<-\\EOF &&\n"> <"\tOBJID\n"> <"\t:100644 100644 OBJID OBJID M\tgreeting\n"> <"\tOBJID\n"> <"\t:000000 100644 OBJID OBJID A\tgreeting\n"> <"\tEOF\n"> <"\tprintf \"\\n%s\\n\" \"something with an ASCII NUL (Q)\" >expect.message &&\n"> <"\tprintf \"%s\\n\" \"helQo\" >expect.hello1 &&\n"> <"\tprintf \"%s\\n\" \"link hello\" >expect.hello2 &&\n"> <"\t{\n"> <"\t\tproperties svn:log \"something with an ASCII NUL (Q)\" &&\n"> <"\t\techo PROPS-END\n"> <"\t} |\n"> <"\tq_to_nul >props &&\n"> <"\t{\n"> <"\t\tq_to_nul <<-\\EOF &&\n"> <"\t\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\t\tRevision-number: 1\n"> <"\t\tProp-content-length: 10\n"> <"\t\tContent-length: 10\n"> <"\n"> <"\t\tPROPS-END\n"> <"\n"> <"\t\tNode-path: greeting\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: add\n"> <"\t\tProp-content-length: 10\n"> <"\t\tText-content-length: 6\n"> <"\t\tContent-length: 16\n"> <"\n"> <"\t\tPROPS-END\n"> <"\t\thelQo\n"> <"\n"> <"\t\tRevision-number: 2\n"> <"\t\tEOF\n"> <"\t\techo Prop-content-length: $(wc -c <"\t\techo Content-length: $(wc -c <"\t\techo &&\n"> <"\t\tcat props &&\n"> <"\t\tq_to_nul <<-\\EOF\n"> <"\n"> <"\t\tNode-path: greeting\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: change\n"> <"\t\tProp-content-length: 43\n"> <"\t\tText-content-length: 11\n"> <"\t\tContent-length: 54\n"> <"\n"> <"\t\tK 21\n"> <"\t\tsvn:specialQnotreally\n"> <"\t\tV 1\n"> <"\t\t*\n"> <"\t\tPROPS-END\n"> <"\t\tlink hello\n"> <"\t\tEOF\n"> <"\t} >8bitclean.dump &&\n"> <"\ttry_dump 8bitclean.dump &&\n"> <"\t{\n"> <"\t\tgit rev-list HEAD |\n"> <"\t\tgit diff-tree --root --stdin |\n"> <"\t\tsed \"s/$_x40/OBJID/g\"\n"> <"\t} >actual &&\n"> <"\t{\n"> <"\t\tgit cat-file commit HEAD | nul_to_q &&\n"> <"\t\techo\n"> <"\t} |\n"> <"\tsed -ne \"/^\\$/,\\$ p\" >actual.message &&\n"> <"\tgit cat-file blob HEAD^:greeting | nul_to_q >actual.hello1 &&\n"> <"\tgit cat-file blob HEAD:greeting | nul_to_q >actual.hello2 &&\n"> <"\ttest_cmp expect actual &&\n"> <"\ttest_cmp expect.message actual.message &&\n"> <"\ttest_cmp expect.hello1 actual.hello1 &&\n"> <"\ttest_cmp expect.hello2 actual.hello2\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"change file mode and reiterate content">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\tcat >expect <<-\\EOF &&\n"> <"\tOBJID\n"> <"\t:120000 100644 OBJID OBJID T\tgreeting\n"> <"\tOBJID\n"> <"\t:100644 120000 OBJID OBJID T\tgreeting\n"> <"\tOBJID\n"> <"\t:000000 100644 OBJID OBJID A\tgreeting\n"> <"\tEOF\n"> <"\techo \"link hello\" >expect.blob &&\n"> <"\techo hello >hello &&\n"> <"\tcat >filemode2.dump <<-\\EOF &&\n"> <"\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\tRevision-number: 1\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: greeting\n"> <"\tNode-kind: file\n"> <"\tNode-action: add\n"> <"\tProp-content-length: 10\n"> <"\tText-content-length: 11\n"> <"\tContent-length: 21\n"> <"\n"> <"\tPROPS-END\n"> <"\tlink hello\n"> <"\n"> <"\tRevision-number: 2\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: greeting\n"> <"\tNode-kind: file\n"> <"\tNode-action: change\n"> <"\tProp-content-length: 33\n"> <"\tText-content-length: 11\n"> <"\tContent-length: 44\n"> <"\n"> <"\tK 11\n"> <"\tsvn:special\n"> <"\tV 1\n"> <"\t*\n"> <"\tPROPS-END\n"> <"\tlink hello\n"> <"\n"> <"\tRevision-number: 3\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: greeting\n"> <"\tNode-kind: file\n"> <"\tNode-action: change\n"> <"\tProp-content-length: 10\n"> <"\tText-content-length: 11\n"> <"\tContent-length: 21\n"> <"\n"> <"\tPROPS-END\n"> <"\tlink hello\n"> <"\tEOF\n"> <"\ttry_dump filemode2.dump &&\n"> <"\t{\n"> <"\t\tgit rev-list HEAD |\n"> <"\t\tgit diff-tree --root --stdin |\n"> <"\t\tsed \"s/$_x40/OBJID/g\"\n"> <"\t} >actual &&\n"> <"\tgit show HEAD:greeting >actual.blob &&\n"> <"\tgit show HEAD^:greeting >actual.target &&\n"> <"\ttest_cmp expect actual &&\n"> <"\ttest_cmp expect.blob actual.blob &&\n"> <"\ttest_cmp hello actual.target\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"deltas supported">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\t{\n"> <"\t\t# (old) h + (inline) ello + (old) \\n\n"> < "\t\tprintf \"SVNQ%b%b%s\" \"Q\\003\\006\\005\\004\" \"\\001Q\\0204\\001\\002\" \"ello\" |\n" > <"\t\tq_to_nul\n"> <"\t} >delta &&\n"> <"\t{\n"> <"\t\tproperties \\\n"> <"\t\t\tsvn:author author@example.com \\\n"> <"\t\t\tsvn:date \"1999-01-05T00:01:002.000000Z\" \\\n"> <"\t\t\tsvn:log \"add greeting\" &&\n"> <"\t\techo PROPS-END\n"> <"\t} >props &&\n"> <"\t{\n"> <"\t\tproperties \\\n"> <"\t\t\tsvn:author author@example.com \\\n"> <"\t\t\tsvn:date \"1999-01-06T00:01:002.000000Z\" \\\n"> <"\t\t\tsvn:log \"change it\" &&\n"> <"\t\techo PROPS-END\n"> <"\t} >props2 &&\n"> <"\t{\n"> <"\t\techo SVN-fs-dump-format-version: 3 &&\n"> <"\t\techo &&\n"> <"\t\techo Revision-number: 1 &&\n"> <"\t\techo Prop-content-length: $(wc -c <"\t\techo Content-length: $(wc -c <"\t\techo &&\n"> <"\t\tcat props &&\n"> <"\t\tcat <<-\\EOF &&\n"> <"\n"> <"\t\tNode-path: hello\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: add\n"> <"\t\tProp-content-length: 10\n"> <"\t\tText-content-length: 3\n"> <"\t\tContent-length: 13\n"> <"\n"> <"\t\tPROPS-END\n"> <"\t\thi\n"> <"\n"> <"\t\tEOF\n"> <"\t\techo Revision-number: 2 &&\n"> <"\t\techo Prop-content-length: $(wc -c <"\t\techo Content-length: $(wc -c <"\t\techo &&\n"> <"\t\tcat props2 &&\n"> <"\t\tcat <<-\\EOF &&\n"> <"\n"> <"\t\tNode-path: hello\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: change\n"> <"\t\tText-delta: true\n"> <"\t\tProp-content-length: 10\n"> <"\t\tEOF\n"> <"\t\techo Text-content-length: $(wc -c <"\t\techo Content-length: $((10 + $(wc -c <"\t\techo &&\n"> <"\t\techo PROPS-END &&\n"> <"\t\tcat delta\n"> <"\t} >delta.dump &&\n"> <"\ttry_dump delta.dump\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"property deltas supported">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\tcat >expect <<-\\EOF &&\n"> <"\tOBJID\n"> <"\t:100755 100644 OBJID OBJID M\tscript.sh\n"> <"\tEOF\n"> <"\t{\n"> <"\t\tproperties \\\n"> <"\t\t\tsvn:author author@example.com \\\n"> <"\t\t\tsvn:date \"1999-03-06T00:01:002.000000Z\" \\\n"> <"\t\t\tsvn:log \"make an executable, or chmod -x it\" &&\n"> <"\t\techo PROPS-END\n"> <"\t} >revprops &&\n"> <"\t{\n"> <"\t\techo SVN-fs-dump-format-version: 3 &&\n"> <"\t\techo &&\n"> <"\t\techo Revision-number: 1 &&\n"> <"\t\techo Prop-content-length: $(wc -c <"\t\techo Content-length: $(wc -c <"\t\techo &&\n"> <"\t\tcat revprops &&\n"> <"\t\techo &&\n"> <"\t\tcat <<-\\EOF &&\n"> <"\t\tNode-path: script.sh\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: add\n"> <"\t\tText-content-length: 0\n"> <"\t\tProp-content-length: 39\n"> <"\t\tContent-length: 39\n"> <"\n"> <"\t\tK 14\n"> <"\t\tsvn:executable\n"> <"\t\tV 4\n"> <"\t\ttrue\n"> <"\t\tPROPS-END\n"> <"\n"> <"\t\tEOF\n"> <"\t\techo Revision-number: 2 &&\n"> <"\t\techo Prop-content-length: $(wc -c <"\t\techo Content-length: $(wc -c <"\t\techo &&\n"> <"\t\tcat revprops &&\n"> <"\t\techo &&\n"> <"\t\tcat <<-\\EOF\n"> <"\t\tNode-path: script.sh\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: change\n"> <"\t\tProp-delta: true\n"> <"\t\tProp-content-length: 30\n"> <"\t\tContent-length: 30\n"> <"\n"> <"\t\tD 14\n"> <"\t\tsvn:executable\n"> <"\t\tPROPS-END\n"> <"\t\tEOF\n"> <"\t} >propdelta.dump &&\n"> <"\ttry_dump propdelta.dump &&\n"> <"\t{\n"> <"\t\tgit rev-list HEAD |\n"> <"\t\tgit diff-tree --stdin |\n"> <"\t\tsed \"s/$_x40/OBJID/g\"\n"> <"\t} >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"properties on /">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\tcat <<-\\EOF >expect &&\n"> <"\tOBJID\n"> <"\tOBJID\n"> <"\t:000000 100644 OBJID OBJID A\tgreeting\n"> <"\tEOF\n"> <"\tsed -e \"s/X$//\" <<-\\EOF >changeroot.dump &&\n"> <"\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\tRevision-number: 1\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: greeting\n"> <"\tNode-kind: file\n"> <"\tNode-action: add\n"> <"\tText-content-length: 0\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tRevision-number: 2\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: X\n"> <"\tNode-kind: dir\n"> <"\tNode-action: change\n"> <"\tProp-delta: true\n"> <"\tProp-content-length: 43\n"> <"\tContent-length: 43\n"> <"\n"> <"\tK 10\n"> <"\tsvn:ignore\n"> <"\tV 11\n"> <"\tbuild-area\n"> <"\n"> <"\tPROPS-END\n"> <"\tEOF\n"> <"\ttry_dump changeroot.dump &&\n"> <"\t{\n"> <"\t\tgit rev-list HEAD |\n"> <"\t\tgit diff-tree --root --always --stdin |\n"> <"\t\tsed \"s/$_x40/OBJID/g\"\n"> <"\t} >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"deltas for typechange">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\tcat >expect <<-\\EOF &&\n"> <"\tOBJID\n"> <"\t:120000 100644 OBJID OBJID T\ttest-file\n"> <"\tOBJID\n"> <"\t:100755 120000 OBJID OBJID T\ttest-file\n"> <"\tOBJID\n"> <"\t:000000 100755 OBJID OBJID A\ttest-file\n"> <"\tEOF\n"> <"\tcat >deleteprop.dump <<-\\EOF &&\n"> <"\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\tRevision-number: 1\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: test-file\n"> <"\tNode-kind: file\n"> <"\tNode-action: add\n"> <"\tProp-delta: true\n"> <"\tProp-content-length: 35\n"> <"\tText-content-length: 17\n"> <"\tContent-length: 52\n"> <"\n"> <"\tK 14\n"> <"\tsvn:executable\n"> <"\tV 0\n"> <"\n"> <"\tPROPS-END\n"> <"\tlink testing 123\n"> <"\n"> <"\tRevision-number: 2\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: test-file\n"> <"\tNode-kind: file\n"> <"\tNode-action: change\n"> <"\tProp-delta: true\n"> <"\tProp-content-length: 53\n"> <"\tText-content-length: 17\n"> <"\tContent-length: 70\n"> <"\n"> <"\tK 11\n"> <"\tsvn:special\n"> <"\tV 1\n"> <"\t*\n"> <"\tD 14\n"> <"\tsvn:executable\n"> <"\tPROPS-END\n"> <"\tlink testing 231\n"> <"\n"> <"\tRevision-number: 3\n"> <"\tProp-content-length: 10\n"> <"\tContent-length: 10\n"> <"\n"> <"\tPROPS-END\n"> <"\n"> <"\tNode-path: test-file\n"> <"\tNode-kind: file\n"> <"\tNode-action: change\n"> <"\tProp-delta: true\n"> <"\tProp-content-length: 27\n"> <"\tText-content-length: 17\n"> <"\tContent-length: 44\n"> <"\n"> <"\tD 11\n"> <"\tsvn:special\n"> <"\tPROPS-END\n"> <"\tlink testing 321\n"> <"\tEOF\n"> <"\ttry_dump deleteprop.dump &&\n"> <"\t{\n"> <"\t\tgit rev-list HEAD |\n"> <"\t\tgit diff-tree --root --stdin |\n"> <"\t\tsed \"s/$_x40/OBJID/g\"\n"> <"\t} >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"deltas need not consume the whole preimage">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\tcat >expect <<-\\EOF &&\n"> <"\tOBJID\n"> <"\t:120000 100644 OBJID OBJID T\tpostimage\n"> <"\tOBJID\n"> <"\t:100644 120000 OBJID OBJID T\tpostimage\n"> <"\tOBJID\n"> <"\t:000000 100644 OBJID OBJID A\tpostimage\n"> <"\tEOF\n"> <"\techo \"first preimage\" >expect.1 &&\n"> <"\tprintf target >expect.2 &&\n"> <"\tprintf lnk >expect.3 &&\n"> <"\t{\n"> <"\t\tprintf \"SVNQ%b%b%b\" \"QQ\\017\\001\\017\" \"\\0217\" \"first preimage\\n\" |\n"> <"\t\tq_to_nul\n"> <"\t} >delta.1 &&\n"> <"\t{\n"> <"\t\tproperties svn:special \"*\" &&\n"> <"\t\techo PROPS-END\n"> <"\t} >symlink.props &&\n"> <"\t{\n"> < "\t\tprintf \"SVNQ%b%b%b\" \"Q\\002\\013\\004\\012\" \"\\0201\\001\\001\\0211\" \"lnk target\" |\n" > <"\t\tq_to_nul\n"> <"\t} >delta.2 &&\n"> <"\t{\n"> <"\t\tprintf \"SVNQ%b%b\" \"Q\\004\\003\\004Q\" \"\\001Q\\002\\002\" |\n"> <"\t\tq_to_nul\n"> <"\t} >delta.3 &&\n"> <"\t{\n"> <"\t\tcat <<-\\EOF &&\n"> <"\t\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\t\tRevision-number: 1\n"> <"\t\tProp-content-length: 10\n"> <"\t\tContent-length: 10\n"> <"\n"> <"\t\tPROPS-END\n"> <"\n"> <"\t\tNode-path: postimage\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: add\n"> <"\t\tText-delta: true\n"> <"\t\tProp-content-length: 10\n"> <"\t\tEOF\n"> <"\t\techo Text-content-length: $(wc -c <"\t\techo Content-length: $((10 + $(wc -c <"\t\techo &&\n"> <"\t\techo PROPS-END &&\n"> <"\t\tcat delta.1 &&\n"> <"\t\tcat <<-\\EOF &&\n"> <"\n"> <"\t\tRevision-number: 2\n"> <"\t\tProp-content-length: 10\n"> <"\t\tContent-length: 10\n"> <"\n"> <"\t\tPROPS-END\n"> <"\n"> <"\t\tNode-path: postimage\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: change\n"> <"\t\tText-delta: true\n"> <"\t\tEOF\n"> <"\t\techo Prop-content-length: $(wc -c <"\t\techo Text-content-length: $(wc -c <"\t\techo Content-length: $(($(wc -c <"\t\techo &&\n"> <"\t\tcat symlink.props &&\n"> <"\t\tcat delta.2 &&\n"> <"\t\tcat <<-\\EOF &&\n"> <"\n"> <"\t\tRevision-number: 3\n"> <"\t\tProp-content-length: 10\n"> <"\t\tContent-length: 10\n"> <"\n"> <"\t\tPROPS-END\n"> <"\n"> <"\t\tNode-path: postimage\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: change\n"> <"\t\tText-delta: true\n"> <"\t\tProp-content-length: 10\n"> <"\t\tEOF\n"> <"\t\techo Text-content-length: $(wc -c <"\t\techo Content-length: $((10 + $(wc -c <"\t\techo &&\n"> <"\t\techo PROPS-END &&\n"> <"\t\tcat delta.3 &&\n"> <"\t\techo\n"> <"\t} >deltapartial.dump &&\n"> <"\ttry_dump deltapartial.dump &&\n"> <"\t{\n"> <"\t\tgit rev-list HEAD |\n"> <"\t\tgit diff-tree --root --stdin |\n"> <"\t\tsed \"s/$_x40/OBJID/g\"\n"> <"\t} >actual &&\n"> <"\ttest_cmp expect actual &&\n"> <"\tgit show HEAD:postimage >actual.3 &&\n"> <"\tgit show HEAD^:postimage >actual.2 &&\n"> <"\tgit show HEAD^^:postimage >actual.1 &&\n"> <"\ttest_cmp expect.1 actual.1 &&\n"> <"\ttest_cmp expect.2 actual.2 &&\n"> <"\ttest_cmp expect.3 actual.3\n"> ) } ) (C {(test_expect_success)} {(PIPE)} {(SQ <"no hang for delta trying to read past end of preimage">)} { (SQ <"\n"> <"\treinit_git &&\n"> <"\t{\n"> <"\t\t# COPY 1\n"> <"\t\tprintf \"SVNQ%b%b\" \"Q\\001\\001\\002Q\" \"\\001Q\" |\n"> <"\t\tq_to_nul\n"> <"\t} >greedy.delta &&\n"> <"\t{\n"> <"\t\tcat <<-\\EOF &&\n"> <"\t\tSVN-fs-dump-format-version: 3\n"> <"\n"> <"\t\tRevision-number: 1\n"> <"\t\tProp-content-length: 10\n"> <"\t\tContent-length: 10\n"> <"\n"> <"\t\tPROPS-END\n"> <"\n"> <"\t\tNode-path: bootstrap\n"> <"\t\tNode-kind: file\n"> <"\t\tNode-action: add\n"> <"\t\tText-delta: true\n"> <"\t\tProp-content-length: 10\n"> <"\t\tEOF\n"> <"\t\techo Text-content-length: $(wc -c <"\t\techo Content-length: $((10 + $(wc -c <"\t\techo &&\n"> <"\t\techo PROPS-END &&\n"> <"\t\tcat greedy.delta &&\n"> <"\t\techo\n"> <"\t} >greedydelta.dump &&\n"> <"\ttry_dump greedydelta.dump must_fail might_fail\n"> ) } ) (C {(test_expect_success)} {(SQ <"set up svn repo">)} { (SQ <"\n"> <"\tsvnconf=$PWD/svnconf &&\n"> <"\tmkdir -p \"$svnconf\" &&\n"> <"\n"> <"\tif\n"> <"\t\tsvnadmin -h >/dev/null 2>&1 &&\n"> <"\t\tsvnadmin create simple-svn &&\n"> <"\t\tsvnadmin load simple-svn <\"$TEST_DIRECTORY/t9135/svn.dump\" &&\n"> <"\t\tsvn export --config-dir \"$svnconf\" \"file://$PWD/simple-svn\" simple-svnco\n"> <"\tthen\n"> <"\t\ttest_set_prereq SVNREPO\n"> <"\tfi\n"> ) } ) (C {(test_expect_success)} {(SVNREPO) (Lit_Comma ",") (PIPE)} {(SQ )} { (SQ <"\n"> <"\tmkdir -p simple-git &&\n"> <"\t(\n"> <"\t\tcd simple-git &&\n"> <"\t\treinit_git &&\n"> <"\t\ttry_dump \"$TEST_DIRECTORY/t9135/svn.dump\"\n"> <"\t) &&\n"> <"\t(\n"> <"\t\tcd simple-svnco &&\n"> <"\t\tgit init &&\n"> <"\t\tgit add . &&\n"> <"\t\tgit fetch ../simple-git master &&\n"> <"\t\tgit diff --exit-code FETCH_HEAD\n"> <"\t)\n"> ) } ) (C {(test_done)}) ] )