From c9ab9ee47836b7c3d8a0c23f7b98c5f14da40c39 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Tue, 26 Aug 2008 21:32:32 +0200 Subject: git svn info: tests: let 'init' test run with SVN 1.5 Signed-off-by: Thomas Rast Acked-by: Eric Wong --- t/t9119-git-svn-info.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh index 5fd36a1483..46676bc05e 100755 --- a/t/t9119-git-svn-info.sh +++ b/t/t9119-git-svn-info.sh @@ -9,9 +9,9 @@ test_description='git-svn info' set -e # Tested with: svn, version 1.4.4 (r25188) -v=`svn --version | sed -n -e 's/^svn, version \(1\.4\.[0-9]\).*$/\1/p'` +v=`svn --version | sed -n -e 's/^svn, version \(1\.[0-9]*\.[0-9]*\).*$/\1/p'` case $v in -1.4.*) +1.[45].*) ;; *) say "skipping svn-info test (SVN version: $v not supported)" -- cgit v1.2.1 From e9a805aa2ac18621853271e33b9aef963bf4e272 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Tue, 26 Aug 2008 21:32:33 +0200 Subject: git svn info: tests: do not use set -e Exiting in the middle of a test confuses the test suite, which will just say "FATAL: Unexpected exit with code 1" in response to a failed test, instead of actually diagnosing failure and continuing with the next test. Signed-off-by: Thomas Rast Acked-by: Eric Wong --- t/t9119-git-svn-info.sh | 2 -- 1 file changed, 2 deletions(-) (limited to 't') diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh index 46676bc05e..a70f2b9af7 100755 --- a/t/t9119-git-svn-info.sh +++ b/t/t9119-git-svn-info.sh @@ -6,8 +6,6 @@ test_description='git-svn info' . ./lib-git-svn.sh -set -e - # Tested with: svn, version 1.4.4 (r25188) v=`svn --version | sed -n -e 's/^svn, version \(1\.[0-9]*\.[0-9]*\).*$/\1/p'` case $v in -- cgit v1.2.1 From 67214c85af7245a1f75da968334c529ec2610e70 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Tue, 26 Aug 2008 21:32:34 +0200 Subject: git svn info: tests: use test_cmp instead of git-diff git-diff does not appear to return the correct exit values, and gives a false success for more than half (!) of the tests due to the space in "trash directory" which git-svn fails to encode. Signed-off-by: Thomas Rast Acked-by: Eric Wong --- t/t9119-git-svn-info.sh | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 't') diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh index a70f2b9af7..7798dcce04 100755 --- a/t/t9119-git-svn-info.sh +++ b/t/t9119-git-svn-info.sh @@ -60,7 +60,7 @@ test_expect_success 'setup repository and import' ' test_expect_success 'info' " (cd svnwc; svn info) > expected.info && (cd gitwc; git-svn info) > actual.info && - git-diff expected.info actual.info + test_cmp expected.info actual.info " test_expect_success 'info --url' ' @@ -70,7 +70,7 @@ test_expect_success 'info --url' ' test_expect_success 'info .' " (cd svnwc; svn info .) > expected.info-dot && (cd gitwc; git-svn info .) > actual.info-dot && - git-diff expected.info-dot actual.info-dot + test_cmp expected.info-dot actual.info-dot " test_expect_success 'info --url .' ' @@ -80,7 +80,7 @@ test_expect_success 'info --url .' ' test_expect_success 'info file' " (cd svnwc; svn info file) > expected.info-file && (cd gitwc; git-svn info file) > actual.info-file && - git-diff expected.info-file actual.info-file + test_cmp expected.info-file actual.info-file " test_expect_success 'info --url file' ' @@ -90,7 +90,7 @@ test_expect_success 'info --url file' ' test_expect_success 'info directory' " (cd svnwc; svn info directory) > expected.info-directory && (cd gitwc; git-svn info directory) > actual.info-directory && - git-diff expected.info-directory actual.info-directory + test_cmp expected.info-directory actual.info-directory " test_expect_success 'info --url directory' ' @@ -100,7 +100,7 @@ test_expect_success 'info --url directory' ' test_expect_success 'info symlink-file' " (cd svnwc; svn info symlink-file) > expected.info-symlink-file && (cd gitwc; git-svn info symlink-file) > actual.info-symlink-file && - git-diff expected.info-symlink-file actual.info-symlink-file + test_cmp expected.info-symlink-file actual.info-symlink-file " test_expect_success 'info --url symlink-file' ' @@ -113,7 +113,7 @@ test_expect_success 'info symlink-directory' " > expected.info-symlink-directory && (cd gitwc; git-svn info symlink-directory) \ > actual.info-symlink-directory && - git-diff expected.info-symlink-directory actual.info-symlink-directory + test_cmp expected.info-symlink-directory actual.info-symlink-directory " test_expect_success 'info --url symlink-directory' ' @@ -133,7 +133,7 @@ test_expect_success 'info added-file' " cd .. && (cd svnwc; svn info added-file) > expected.info-added-file && (cd gitwc; git-svn info added-file) > actual.info-added-file && - git-diff expected.info-added-file actual.info-added-file + test_cmp expected.info-added-file actual.info-added-file " test_expect_success 'info --url added-file' ' @@ -155,7 +155,7 @@ test_expect_success 'info added-directory' " > expected.info-added-directory && (cd gitwc; git-svn info added-directory) \ > actual.info-added-directory && - git-diff expected.info-added-directory actual.info-added-directory + test_cmp expected.info-added-directory actual.info-added-directory " test_expect_success 'info --url added-directory' ' @@ -177,7 +177,7 @@ test_expect_success 'info added-symlink-file' " > expected.info-added-symlink-file && (cd gitwc; git-svn info added-symlink-file) \ > actual.info-added-symlink-file && - git-diff expected.info-added-symlink-file \ + test_cmp expected.info-added-symlink-file \ actual.info-added-symlink-file " @@ -200,7 +200,7 @@ test_expect_success 'info added-symlink-directory' " > expected.info-added-symlink-directory && (cd gitwc; git-svn info added-symlink-directory) \ > actual.info-added-symlink-directory && - git-diff expected.info-added-symlink-directory \ + test_cmp expected.info-added-symlink-directory \ actual.info-added-symlink-directory " @@ -227,7 +227,7 @@ test_expect_success 'info deleted-file' " (cd gitwc; git-svn info file) | sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \ > actual.info-deleted-file && - git-diff expected.info-deleted-file actual.info-deleted-file + test_cmp expected.info-deleted-file actual.info-deleted-file " test_expect_success 'info --url file (deleted)' ' @@ -248,7 +248,7 @@ test_expect_success 'info deleted-directory' " (cd gitwc; git-svn info directory) | sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \ > actual.info-deleted-directory && - git-diff expected.info-deleted-directory actual.info-deleted-directory + test_cmp expected.info-deleted-directory actual.info-deleted-directory " test_expect_success 'info --url directory (deleted)' ' @@ -269,7 +269,7 @@ test_expect_success 'info deleted-symlink-file' " (cd gitwc; git-svn info symlink-file) | sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \ > actual.info-deleted-symlink-file && - git-diff expected.info-deleted-symlink-file \ + test_cmp expected.info-deleted-symlink-file \ actual.info-deleted-symlink-file " @@ -291,7 +291,7 @@ test_expect_success 'info deleted-symlink-directory' " (cd gitwc; git-svn info symlink-directory) | sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \ > actual.info-deleted-symlink-directory && - git-diff expected.info-deleted-symlink-directory \ + test_cmp expected.info-deleted-symlink-directory \ actual.info-deleted-symlink-directory " @@ -309,13 +309,13 @@ test_expect_success 'info unknown-file' " ptouch gitwc/unknown-file svnwc/unknown-file && (cd svnwc; svn info unknown-file) 2> expected.info-unknown-file && (cd gitwc; git-svn info unknown-file) 2> actual.info-unknown-file && - git-diff expected.info-unknown-file actual.info-unknown-file + test_cmp expected.info-unknown-file actual.info-unknown-file " test_expect_success 'info --url unknown-file' ' test -z "$(cd gitwc; git-svn info --url unknown-file \ 2> ../actual.info--url-unknown-file)" && - git-diff expected.info-unknown-file actual.info--url-unknown-file + test_cmp expected.info-unknown-file actual.info--url-unknown-file ' test_expect_success 'info unknown-directory' " @@ -326,13 +326,13 @@ test_expect_success 'info unknown-directory' " 2> expected.info-unknown-directory && (cd gitwc; git-svn info unknown-directory) \ 2> actual.info-unknown-directory && - git-diff expected.info-unknown-directory actual.info-unknown-directory + test_cmp expected.info-unknown-directory actual.info-unknown-directory " test_expect_success 'info --url unknown-directory' ' test -z "$(cd gitwc; git-svn info --url unknown-directory \ 2> ../actual.info--url-unknown-directory)" && - git-diff expected.info-unknown-directory \ + test_cmp expected.info-unknown-directory \ actual.info--url-unknown-directory ' @@ -348,14 +348,14 @@ test_expect_success 'info unknown-symlink-file' " 2> expected.info-unknown-symlink-file && (cd gitwc; git-svn info unknown-symlink-file) \ 2> actual.info-unknown-symlink-file && - git-diff expected.info-unknown-symlink-file \ + test_cmp expected.info-unknown-symlink-file \ actual.info-unknown-symlink-file " test_expect_success 'info --url unknown-symlink-file' ' test -z "$(cd gitwc; git-svn info --url unknown-symlink-file \ 2> ../actual.info--url-unknown-symlink-file)" && - git-diff expected.info-unknown-symlink-file \ + test_cmp expected.info-unknown-symlink-file \ actual.info--url-unknown-symlink-file ' @@ -372,14 +372,14 @@ test_expect_success 'info unknown-symlink-directory' " 2> expected.info-unknown-symlink-directory && (cd gitwc; git-svn info unknown-symlink-directory) \ 2> actual.info-unknown-symlink-directory && - git-diff expected.info-unknown-symlink-directory \ + test_cmp expected.info-unknown-symlink-directory \ actual.info-unknown-symlink-directory " test_expect_success 'info --url unknown-symlink-directory' ' test -z "$(cd gitwc; git-svn info --url unknown-symlink-directory \ 2> ../actual.info--url-unknown-symlink-directory)" && - git-diff expected.info-unknown-symlink-directory \ + test_cmp expected.info-unknown-symlink-directory \ actual.info--url-unknown-symlink-directory ' -- cgit v1.2.1 From 8d5100c7a81e7f638241b5af957e05216cd56579 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Tue, 26 Aug 2008 21:32:35 +0200 Subject: git svn info: tests: fix ptouch argument order in setup The arguments must be , otherwise it fails to update the timestamps (without setting a failure exit code) and results in bad test output later on. Signed-off-by: Thomas Rast Acked-by: Eric Wong --- t/t9119-git-svn-info.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 't') diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh index 7798dcce04..821507d416 100755 --- a/t/t9119-git-svn-info.sh +++ b/t/t9119-git-svn-info.sh @@ -51,10 +51,10 @@ test_expect_success 'setup repository and import' ' git-svn fetch && cd .. && svn co "$svnrepo" svnwc && - ptouch svnwc/file gitwc/file && - ptouch svnwc/directory gitwc/directory && - ptouch svnwc/symlink-file gitwc/symlink-file && - ptouch svnwc/symlink-directory gitwc/symlink-directory + ptouch gitwc/file svnwc/file && + ptouch gitwc/directory svnwc/directory && + ptouch gitwc/symlink-file svnwc/symlink-file && + ptouch gitwc/symlink-directory svnwc/symlink-directory ' test_expect_success 'info' " -- cgit v1.2.1 From edde9112abd1ef5f4565468e8a9a500e0c03f900 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Tue, 26 Aug 2008 21:32:36 +0200 Subject: git svn info: make info relative to the current directory Previously 'git svn info ' would always treat the as relative to the working directory root, with a default of ".". This does not match the behaviour of 'svn info'. Prepend $(git rev-parse --show-prefix) to the path used inside cmd_info to make it relative to the current working directory. Signed-off-by: Thomas Rast Acked-by: Eric Wong --- t/t9119-git-svn-info.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh index 821507d416..8709bcc49c 100755 --- a/t/t9119-git-svn-info.sh +++ b/t/t9119-git-svn-info.sh @@ -45,12 +45,18 @@ test_expect_success 'setup repository and import' ' ln -s directory symlink-directory && svn import -m "initial" . "$svnrepo" && cd .. && + svn co "$svnrepo" svnwc && + cd svnwc && + echo foo > foo && + svn add foo && + svn commit -m "change outside directory" && + svn update && + cd .. && mkdir gitwc && cd gitwc && git-svn init "$svnrepo" && git-svn fetch && cd .. && - svn co "$svnrepo" svnwc && ptouch gitwc/file svnwc/file && ptouch gitwc/directory svnwc/directory && ptouch gitwc/symlink-file svnwc/symlink-file && @@ -93,6 +99,12 @@ test_expect_success 'info directory' " test_cmp expected.info-directory actual.info-directory " +test_expect_success 'info inside directory' " + (cd svnwc/directory; svn info) > expected.info-inside-directory && + (cd gitwc/directory; git-svn info) > actual.info-inside-directory && + test_cmp expected.info-inside-directory actual.info-inside-directory + " + test_expect_success 'info --url directory' ' test "$(cd gitwc; git-svn info --url directory)" = "$svnrepo/directory" ' -- cgit v1.2.1 From 05427b91f0b5e45688cbea21faf0f2d79ec07b21 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Tue, 26 Aug 2008 21:32:37 +0200 Subject: git svn info: always quote URLs in 'info' output Changes 'git svn info' to always URL-escape the 'URL' and 'Repository' fields and --url output, like SVN (at least 1.5) does. Note that reusing the escape_url() further down in Git::SVN::Ra is not possible because it only triggers for http(s) URLs. I did not know whether extending it to all schemes would break SVN access anywhere, so I made a new one that quotes in all schemes. Signed-off-by: Thomas Rast Acked-by: Eric Wong --- t/t9119-git-svn-info.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 't') diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh index 8709bcc49c..181101010f 100755 --- a/t/t9119-git-svn-info.sh +++ b/t/t9119-git-svn-info.sh @@ -34,6 +34,8 @@ ptouch() { ' "`svn info $2 | grep '^Text Last Updated:'`" "$1" } +quoted_svnrepo="$(echo $svnrepo | sed 's/ /%20/')" + test_expect_success 'setup repository and import' ' mkdir info && cd info && @@ -70,7 +72,7 @@ test_expect_success 'info' " " test_expect_success 'info --url' ' - test "$(cd gitwc; git-svn info --url)" = "$svnrepo" + test "$(cd gitwc; git-svn info --url)" = "$quoted_svnrepo" ' test_expect_success 'info .' " @@ -80,7 +82,7 @@ test_expect_success 'info .' " " test_expect_success 'info --url .' ' - test "$(cd gitwc; git-svn info --url .)" = "$svnrepo" + test "$(cd gitwc; git-svn info --url .)" = "$quoted_svnrepo" ' test_expect_success 'info file' " @@ -90,7 +92,7 @@ test_expect_success 'info file' " " test_expect_success 'info --url file' ' - test "$(cd gitwc; git-svn info --url file)" = "$svnrepo/file" + test "$(cd gitwc; git-svn info --url file)" = "$quoted_svnrepo/file" ' test_expect_success 'info directory' " @@ -106,7 +108,7 @@ test_expect_success 'info inside directory' " " test_expect_success 'info --url directory' ' - test "$(cd gitwc; git-svn info --url directory)" = "$svnrepo/directory" + test "$(cd gitwc; git-svn info --url directory)" = "$quoted_svnrepo/directory" ' test_expect_success 'info symlink-file' " @@ -117,7 +119,7 @@ test_expect_success 'info symlink-file' " test_expect_success 'info --url symlink-file' ' test "$(cd gitwc; git-svn info --url symlink-file)" \ - = "$svnrepo/symlink-file" + = "$quoted_svnrepo/symlink-file" ' test_expect_success 'info symlink-directory' " @@ -130,7 +132,7 @@ test_expect_success 'info symlink-directory' " test_expect_success 'info --url symlink-directory' ' test "$(cd gitwc; git-svn info --url symlink-directory)" \ - = "$svnrepo/symlink-directory" + = "$quoted_svnrepo/symlink-directory" ' test_expect_success 'info added-file' " @@ -150,7 +152,7 @@ test_expect_success 'info added-file' " test_expect_success 'info --url added-file' ' test "$(cd gitwc; git-svn info --url added-file)" \ - = "$svnrepo/added-file" + = "$quoted_svnrepo/added-file" ' test_expect_success 'info added-directory' " @@ -172,7 +174,7 @@ test_expect_success 'info added-directory' " test_expect_success 'info --url added-directory' ' test "$(cd gitwc; git-svn info --url added-directory)" \ - = "$svnrepo/added-directory" + = "$quoted_svnrepo/added-directory" ' test_expect_success 'info added-symlink-file' " @@ -195,7 +197,7 @@ test_expect_success 'info added-symlink-file' " test_expect_success 'info --url added-symlink-file' ' test "$(cd gitwc; git-svn info --url added-symlink-file)" \ - = "$svnrepo/added-symlink-file" + = "$quoted_svnrepo/added-symlink-file" ' test_expect_success 'info added-symlink-directory' " @@ -218,7 +220,7 @@ test_expect_success 'info added-symlink-directory' " test_expect_success 'info --url added-symlink-directory' ' test "$(cd gitwc; git-svn info --url added-symlink-directory)" \ - = "$svnrepo/added-symlink-directory" + = "$quoted_svnrepo/added-symlink-directory" ' # The next few tests replace the "Text Last Updated" value with a @@ -244,7 +246,7 @@ test_expect_success 'info deleted-file' " test_expect_success 'info --url file (deleted)' ' test "$(cd gitwc; git-svn info --url file)" \ - = "$svnrepo/file" + = "$quoted_svnrepo/file" ' test_expect_success 'info deleted-directory' " @@ -265,7 +267,7 @@ test_expect_success 'info deleted-directory' " test_expect_success 'info --url directory (deleted)' ' test "$(cd gitwc; git-svn info --url directory)" \ - = "$svnrepo/directory" + = "$quoted_svnrepo/directory" ' test_expect_success 'info deleted-symlink-file' " @@ -287,7 +289,7 @@ test_expect_success 'info deleted-symlink-file' " test_expect_success 'info --url symlink-file (deleted)' ' test "$(cd gitwc; git-svn info --url symlink-file)" \ - = "$svnrepo/symlink-file" + = "$quoted_svnrepo/symlink-file" ' test_expect_success 'info deleted-symlink-directory' " @@ -309,7 +311,7 @@ test_expect_success 'info deleted-symlink-directory' " test_expect_success 'info --url symlink-directory (deleted)' ' test "$(cd gitwc; git-svn info --url symlink-directory)" \ - = "$svnrepo/symlink-directory" + = "$quoted_svnrepo/symlink-directory" ' # NOTE: git does not have the concept of replaced objects, -- cgit v1.2.1 From 4457d4f767f0744e7936be449c3d25c507b7591a Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Fri, 29 Aug 2008 15:42:49 +0200 Subject: git-svn: fix 'info' tests for unknown items The previous tests all expected the results from SVN and Git to be identical, and expected both to return success. This cannot be guaranteed: SVN changed the message style between 1.4 and 1.5, and in 1.5, sets a failure exit code. Change the tests to verify that 'git svn info ' sets a failure exit code, and that its output contains the file name. This should hopefully catch all other errors. Signed-off-by: Thomas Rast Acked-by: Eric Wong --- t/t9119-git-svn-info.sh | 73 +++++++++++++++++-------------------------------- 1 file changed, 25 insertions(+), 48 deletions(-) (limited to 't') diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh index 181101010f..3e484594a7 100755 --- a/t/t9119-git-svn-info.sh +++ b/t/t9119-git-svn-info.sh @@ -319,82 +319,59 @@ test_expect_success 'info --url symlink-directory (deleted)' ' test_expect_success 'info unknown-file' " echo two > gitwc/unknown-file && - cp gitwc/unknown-file svnwc/unknown-file && - ptouch gitwc/unknown-file svnwc/unknown-file && - (cd svnwc; svn info unknown-file) 2> expected.info-unknown-file && - (cd gitwc; git-svn info unknown-file) 2> actual.info-unknown-file && - test_cmp expected.info-unknown-file actual.info-unknown-file + (cd gitwc; test_must_fail git-svn info unknown-file) \ + 2> actual.info-unknown-file && + grep unknown-file actual.info-unknown-file " test_expect_success 'info --url unknown-file' ' - test -z "$(cd gitwc; git-svn info --url unknown-file \ - 2> ../actual.info--url-unknown-file)" && - test_cmp expected.info-unknown-file actual.info--url-unknown-file + echo two > gitwc/unknown-file && + (cd gitwc; test_must_fail git-svn info --url unknown-file) \ + 2> actual.info-url-unknown-file && + grep unknown-file actual.info-url-unknown-file ' test_expect_success 'info unknown-directory' " mkdir gitwc/unknown-directory svnwc/unknown-directory && - ptouch gitwc/unknown-directory svnwc/unknown-directory && - touch gitwc/unknown-directory/.placeholder && - (cd svnwc; svn info unknown-directory) \ - 2> expected.info-unknown-directory && - (cd gitwc; git-svn info unknown-directory) \ - 2> actual.info-unknown-directory && - test_cmp expected.info-unknown-directory actual.info-unknown-directory + (cd gitwc; test_must_fail git-svn info unknown-directory) \ + 2> actual.info-unknown-directory && + grep unknown-directory actual.info-unknown-directory " test_expect_success 'info --url unknown-directory' ' - test -z "$(cd gitwc; git-svn info --url unknown-directory \ - 2> ../actual.info--url-unknown-directory)" && - test_cmp expected.info-unknown-directory \ - actual.info--url-unknown-directory + (cd gitwc; test_must_fail git-svn info --url unknown-directory) \ + 2> actual.info-url-unknown-directory && + grep unknown-directory actual.info-url-unknown-directory ' test_expect_success 'info unknown-symlink-file' " cd gitwc && ln -s unknown-file unknown-symlink-file && cd .. && - cd svnwc && - ln -s unknown-file unknown-symlink-file && - cd .. && - ptouch gitwc/unknown-symlink-file svnwc/unknown-symlink-file && - (cd svnwc; svn info unknown-symlink-file) \ - 2> expected.info-unknown-symlink-file && - (cd gitwc; git-svn info unknown-symlink-file) \ - 2> actual.info-unknown-symlink-file && - test_cmp expected.info-unknown-symlink-file \ - actual.info-unknown-symlink-file + (cd gitwc; test_must_fail git-svn info unknown-symlink-file) \ + 2> actual.info-unknown-symlink-file && + grep unknown-symlink-file actual.info-unknown-symlink-file " test_expect_success 'info --url unknown-symlink-file' ' - test -z "$(cd gitwc; git-svn info --url unknown-symlink-file \ - 2> ../actual.info--url-unknown-symlink-file)" && - test_cmp expected.info-unknown-symlink-file \ - actual.info--url-unknown-symlink-file + (cd gitwc; test_must_fail git-svn info --url unknown-symlink-file) \ + 2> actual.info-url-unknown-symlink-file && + grep unknown-symlink-file actual.info-url-unknown-symlink-file ' test_expect_success 'info unknown-symlink-directory' " cd gitwc && ln -s unknown-directory unknown-symlink-directory && cd .. && - cd svnwc && - ln -s unknown-directory unknown-symlink-directory && - cd .. && - ptouch gitwc/unknown-symlink-directory \ - svnwc/unknown-symlink-directory && - (cd svnwc; svn info unknown-symlink-directory) \ - 2> expected.info-unknown-symlink-directory && - (cd gitwc; git-svn info unknown-symlink-directory) \ - 2> actual.info-unknown-symlink-directory && - test_cmp expected.info-unknown-symlink-directory \ - actual.info-unknown-symlink-directory + (cd gitwc; test_must_fail git-svn info unknown-symlink-directory) \ + 2> actual.info-unknown-symlink-directory && + grep unknown-symlink-directory actual.info-unknown-symlink-directory " test_expect_success 'info --url unknown-symlink-directory' ' - test -z "$(cd gitwc; git-svn info --url unknown-symlink-directory \ - 2> ../actual.info--url-unknown-symlink-directory)" && - test_cmp expected.info-unknown-symlink-directory \ - actual.info--url-unknown-symlink-directory + (cd gitwc; test_must_fail git-svn info --url unknown-symlink-directory) \ + 2> actual.info-url-unknown-symlink-directory && + grep unknown-symlink-directory actual.info-url-unknown-symlink-directory ' test_done -- cgit v1.2.1 From a786091b4a487bc08bbff4864717cf5d8383e983 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 6 Sep 2008 18:29:12 -0700 Subject: t9124: clean up chdir usage Spawn subshells when running things in subdirectories instead of chdir-ing to the path of an undefined variable, which is confusing. Signed-off-by: Eric Wong --- t/t9124-git-svn-dcommit-auto-props.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 't') diff --git a/t/t9124-git-svn-dcommit-auto-props.sh b/t/t9124-git-svn-dcommit-auto-props.sh index 8223c5909e..54276bf115 100755 --- a/t/t9124-git-svn-dcommit-auto-props.sh +++ b/t/t9124-git-svn-dcommit-auto-props.sh @@ -29,13 +29,11 @@ test_expect_success 'initialize git-svn' ' ' test_expect_success 'enable auto-props config' ' - cd "$gittestrepo" && mkdir user && generate_auto_props yes >user/config ' test_expect_success 'add files matching auto-props' ' - cd "$gittestrepo" && echo "#!$SHELL_PATH" >exec1.sh && chmod +x exec1.sh && echo "hello" >hello.txt && @@ -46,12 +44,10 @@ test_expect_success 'add files matching auto-props' ' ' test_expect_success 'disable auto-props config' ' - cd "$gittestrepo" && generate_auto_props no >user/config ' test_expect_success 'add files matching disabled auto-props' ' - cd "$gittestrepo" && echo "#$SHELL_PATH" >exec2.sh && chmod +x exec2.sh && echo "world" >world.txt && @@ -62,6 +58,7 @@ test_expect_success 'add files matching disabled auto-props' ' ' test_expect_success 'check resulting svn repository' ' +( mkdir work && cd work && svn co "$svnrepo" && @@ -81,6 +78,7 @@ test_expect_success 'check resulting svn repository' ' test "x$(svn propget svn:mime-type world.txt)" = "x" && test "x$(svn propget svn:eol-style world.txt)" = "x" && test "x$(svn propget svn:mime-type zot)" = "x" +) ' test_done -- cgit v1.2.1 From 7c4d0219cf9ab6a7738a09ad7fec72d5e9f2ac67 Mon Sep 17 00:00:00 2001 From: Paul Talacko Date: Sat, 6 Sep 2008 18:50:38 -0700 Subject: git-svn: set auto_props when renaming files Patch-by: Paul Talacko : > Hello, > > There's an issue in git-svn as autoprops are not applied to > renamed files, only to added files. > > This patch fixes the bug. [ew: added test case] Signed-off-by: Eric Wong --- t/t9124-git-svn-dcommit-auto-props.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 't') diff --git a/t/t9124-git-svn-dcommit-auto-props.sh b/t/t9124-git-svn-dcommit-auto-props.sh index 54276bf115..31193a382a 100755 --- a/t/t9124-git-svn-dcommit-auto-props.sh +++ b/t/t9124-git-svn-dcommit-auto-props.sh @@ -81,4 +81,21 @@ test_expect_success 'check resulting svn repository' ' ) ' +test_expect_success 'check renamed file' ' + test -d user && + generate_auto_props yes > user/config && + git mv foo foo.sh && + git commit -m "foo => foo.sh" && + git svn dcommit --config-dir=user && + ( + cd work/svnrepo && + svn up && + test ! -e foo && + test -e foo.sh && + test "x$(svn propget svn:mime-type foo.sh)" = \ + "xapplication/x-shellscript" && + test "x$(svn propget svn:eol-style foo.sh)" = "xLF" + ) +' + test_done -- cgit v1.2.1