{"thread":{"id":"12974","subject":"[PATCH/BUG] git-svn: add test for renamed directory fetch","startedAt":"2008-04-03T13:47:21Z","lastAt":"2008-04-07T07:08:03Z","messageCount":3,"participants":["Santhosh","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"73601","messageId":"3bc895b00804030647o652e432cqb5a90eafbac906b2@mail.gmail.com","threadId":"12974","inReplyTo":null,"subject":"[PATCH/BUG] git-svn: add test for renamed directory fetch","fromName":"Santhosh","fromEmail":"santhoshmani@gmail.com","sentAt":"2008-04-03T13:47:21Z","receivedAt":"2008-04-03T13:47:21Z","isPatch":true,"sender":{"key":"santhoshmani@gmail.com","avatar":null},"body":"This test tries to fetch a directory which had renames in the history from a\nSVN repository.\n---\n t/t9121-git-svn-fetch-renamed-dir.sh |   23 +++++++++\n t/t9121/renamed-dir.dump             |   90 ++++++++++++++++++++++++++++++++++\n 2 files changed, 113 insertions(+), 0 deletions(-)\n create mode 100755 t/t9121-git-svn-fetch-renamed-dir.sh\n create mode 100644 t/t9121/renamed-dir.dump\n\ndiff --git a/t/t9121-git-svn-fetch-renamed-dir.sh\nb/t/t9121-git-svn-fetch-renamed-dir.sh\nnew file mode 100755\nindex 0000000..5cd65a6\n--- /dev/null\n+++ b/t/t9121-git-svn-fetch-renamed-dir.sh\n@@ -0,0 +1,23 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Santhosh Kumar Mani\n+\n+\n+test_description='git-svn can fetch renamed directories'\n+\n+. ./lib-git-svn.sh\n+\n+test_expect_success 'load repository with renamed directory' \"\n+\tsvnadmin load -q $rawsvnrepo < ../t9121/renamed-dir.dump &&\n+\tstart_httpd\n+\t\"\n+\n+test_expect_success 'init and fetch repository' \"\n+\tgit svn init $svnrepo/newname &&\n+\tgit svn fetch\n+\t\"\n+\n+stop_httpd\n+\n+test_done\n+\ndiff --git a/t/t9121/renamed-dir.dump b/t/t9121/renamed-dir.dump\nnew file mode 100644\nindex 0000000..5f9127b\n--- /dev/null\n+++ b/t/t9121/renamed-dir.dump\n@@ -0,0 +1,90 @@\n+SVN-fs-dump-format-version: 2\n+\n+UUID: 06b9b3ad-f546-4fbe-8328-fcb4e6ef5c3f\n+\n+Revision-number: 0\n+Prop-content-length: 56\n+Content-length: 56\n+\n+K 8\n+svn:date\n+V 27\n+2008-04-02T09:11:59.778557Z\n+PROPS-END\n+\n+Revision-number: 1\n+Prop-content-length: 117\n+Content-length: 117\n+\n+K 7\n+svn:log\n+V 14\n+initial import\n+K 10\n+svn:author\n+V 8\n+santhosh\n+K 8\n+svn:date\n+V 27\n+2008-04-02T09:13:03.170863Z\n+PROPS-END\n+\n+Node-path: name\n+Node-kind: dir\n+Node-action: add\n+Prop-content-length: 10\n+Content-length: 10\n+\n+PROPS-END\n+\n+\n+Node-path: name/a.txt\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 71\n+Text-content-length: 6\n+Text-content-md5: b1946ac92492d2347c6235b4d2611184\n+Content-length: 77\n+\n+K 13\n+svn:mime-type\n+V 10\n+text/plain\n+K 13\n+svn:eol-style\n+V 2\n+LF\n+PROPS-END\n+hello\n+\n+\n+Revision-number: 2\n+Prop-content-length: 109\n+Content-length: 109\n+\n+K 7\n+svn:log\n+V 7\n+renamed\n+K 10\n+svn:author\n+V 8\n+santhosh\n+K 8\n+svn:date\n+V 27\n+2008-04-02T09:14:22.952186Z\n+PROPS-END\n+\n+Node-path: newname\n+Node-kind: dir\n+Node-action: add\n+Node-copyfrom-rev: 1\n+Node-copyfrom-path: name\n+\n+\n+Node-path: name\n+Node-action: delete\n+\n+\n-- \n1.5.5.rc3.dirty\n\n\nFrom 30fa29a45be3b8c0f470c0ac55f820a48e53a938 Mon Sep 17 00:00:00 2001\nFrom: Santhosh Kumar Mani <santhoshmani@gmail.com>\nDate: Thu, 3 Apr 2008 15:40:15 +0530\nSubject: [PATCH] git-svn: add test for renamed directory fetch\n\nThis test tries to fetch a directory which had renames in the history from a\nSVN repository.\n---\n t/t9121-git-svn-fetch-renamed-dir.sh |   23 +++++++++\n t/t9121/renamed-dir.dump             |   90 ++++++++++++++++++++++++++++++++++\n 2 files changed, 113 insertions(+), 0 deletions(-)\n create mode 100755 t/t9121-git-svn-fetch-renamed-dir.sh\n create mode 100644 t/t9121/renamed-dir.dump\n\ndiff --git a/t/t9121-git-svn-fetch-renamed-dir.sh b/t/t9121-git-svn-fetch-renamed-dir.sh\nnew file mode 100755\nindex 0000000..5cd65a6\n--- /dev/null\n+++ b/t/t9121-git-svn-fetch-renamed-dir.sh\n@@ -0,0 +1,23 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Santhosh Kumar Mani\n+\n+\n+test_description='git-svn can fetch renamed directories'\n+\n+. ./lib-git-svn.sh\n+\n+test_expect_success 'load repository with renamed directory' \"\n+\tsvnadmin load -q $rawsvnrepo < ../t9121/renamed-dir.dump &&\n+\tstart_httpd\n+\t\"\n+\n+test_expect_success 'init and fetch repository' \"\n+\tgit svn init $svnrepo/newname &&\n+\tgit svn fetch\n+\t\"\n+\n+stop_httpd\n+\n+test_done\n+\ndiff --git a/t/t9121/renamed-dir.dump b/t/t9121/renamed-dir.dump\nnew file mode 100644\nindex 0000000..5f9127b\n--- /dev/null\n+++ b/t/t9121/renamed-dir.dump\n@@ -0,0 +1,90 @@\n+SVN-fs-dump-format-version: 2\n+\n+UUID: 06b9b3ad-f546-4fbe-8328-fcb4e6ef5c3f\n+\n+Revision-number: 0\n+Prop-content-length: 56\n+Content-length: 56\n+\n+K 8\n+svn:date\n+V 27\n+2008-04-02T09:11:59.778557Z\n+PROPS-END\n+\n+Revision-number: 1\n+Prop-content-length: 117\n+Content-length: 117\n+\n+K 7\n+svn:log\n+V 14\n+initial import\n+K 10\n+svn:author\n+V 8\n+santhosh\n+K 8\n+svn:date\n+V 27\n+2008-04-02T09:13:03.170863Z\n+PROPS-END\n+\n+Node-path: name\n+Node-kind: dir\n+Node-action: add\n+Prop-content-length: 10\n+Content-length: 10\n+\n+PROPS-END\n+\n+\n+Node-path: name/a.txt\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 71\n+Text-content-length: 6\n+Text-content-md5: b1946ac92492d2347c6235b4d2611184\n+Content-length: 77\n+\n+K 13\n+svn:mime-type\n+V 10\n+text/plain\n+K 13\n+svn:eol-style\n+V 2\n+LF\n+PROPS-END\n+hello\n+\n+\n+Revision-number: 2\n+Prop-content-length: 109\n+Content-length: 109\n+\n+K 7\n+svn:log\n+V 7\n+renamed\n+K 10\n+svn:author\n+V 8\n+santhosh\n+K 8\n+svn:date\n+V 27\n+2008-04-02T09:14:22.952186Z\n+PROPS-END\n+\n+Node-path: newname\n+Node-kind: dir\n+Node-action: add\n+Node-copyfrom-rev: 1\n+Node-copyfrom-path: name\n+\n+\n+Node-path: name\n+Node-action: delete\n+\n+\n-- \n1.5.5.rc3.dirty\n\n"},{"id":"73604","messageId":"3bc895b00804030659p21dcae2av2cad3db41935fa4e@mail.gmail.com","threadId":"12974","inReplyTo":"3bc895b00804030647o652e432cqb5a90eafbac906b2@mail.gmail.com","subject":"Re: [PATCH/BUG] git-svn: add test for renamed directory fetch","fromName":"Santhosh","fromEmail":"santhoshmani@gmail.com","sentAt":"2008-04-03T13:59:27Z","receivedAt":"2008-04-03T13:59:27Z","isPatch":true,"sender":{"key":"santhoshmani@gmail.com","avatar":null},"body":"git svn init svn://zzz/trunk/yyy (/some/path/with/rename/history)\ngit svn fetch\n\nresults in the following error if the \"path\" being fetched was renamed\nin the past.\n\nbranch_from: /xxx => /xxx/trunk/yyy\nFound possible branch point: svn://xxx/trunk/yyy => svn://zzz/trunk/yyy, 7\nInitializing parent: git-svn@7\nsvn-remote.svn.url already set: svn://zzz/trunk/yyy\nwanted to set to: svn://xxx/trunk/yyy\n\nThe above patch (testcase) exposes this bug. It seems to have been\nintroduced in the commit \"c586879cdfa4f8181a14e953a9152a4639eef333\".\nReverting this patch fixes this bug.\n\nRegards,\nSanthosh.\n\nOn Thu, Apr 3, 2008 at 7:17 PM, Santhosh <santhoshmani@gmail.com> wrote:\n> This test tries to fetch a directory which had renames in the history from a\n>  SVN repository.\n>  ---\n>   t/t9121-git-svn-fetch-renamed-dir.sh |   23 +++++++++\n>   t/t9121/renamed-dir.dump             |   90 ++++++++++++++++++++++++++++++++++\n>   2 files changed, 113 insertions(+), 0 deletions(-)\n>   create mode 100755 t/t9121-git-svn-fetch-renamed-dir.sh\n>   create mode 100644 t/t9121/renamed-dir.dump\n>\n>  diff --git a/t/t9121-git-svn-fetch-renamed-dir.sh\n>  b/t/t9121-git-svn-fetch-renamed-dir.sh\n>  new file mode 100755\n>  index 0000000..5cd65a6\n>  --- /dev/null\n>  +++ b/t/t9121-git-svn-fetch-renamed-dir.sh\n>  @@ -0,0 +1,23 @@\n>  +#!/bin/sh\n>  +#\n>  +# Copyright (c) 2008 Santhosh Kumar Mani\n>  +\n>  +\n>  +test_description='git-svn can fetch renamed directories'\n>  +\n>  +. ./lib-git-svn.sh\n>  +\n>  +test_expect_success 'load repository with renamed directory' \"\n>  +       svnadmin load -q $rawsvnrepo < ../t9121/renamed-dir.dump &&\n>  +       start_httpd\n>  +       \"\n>  +\n>  +test_expect_success 'init and fetch repository' \"\n>  +       git svn init $svnrepo/newname &&\n>  +       git svn fetch\n>  +       \"\n>  +\n>  +stop_httpd\n>  +\n>  +test_done\n>  +\n>  diff --git a/t/t9121/renamed-dir.dump b/t/t9121/renamed-dir.dump\n>  new file mode 100644\n>  index 0000000..5f9127b\n>  --- /dev/null\n>  +++ b/t/t9121/renamed-dir.dump\n>  @@ -0,0 +1,90 @@\n>  +SVN-fs-dump-format-version: 2\n>  +\n>  +UUID: 06b9b3ad-f546-4fbe-8328-fcb4e6ef5c3f\n>  +\n>  +Revision-number: 0\n>  +Prop-content-length: 56\n>  +Content-length: 56\n>  +\n>  +K 8\n>  +svn:date\n>  +V 27\n>  +2008-04-02T09:11:59.778557Z\n>  +PROPS-END\n>  +\n>  +Revision-number: 1\n>  +Prop-content-length: 117\n>  +Content-length: 117\n>  +\n>  +K 7\n>  +svn:log\n>  +V 14\n>  +initial import\n>  +K 10\n>  +svn:author\n>  +V 8\n>  +santhosh\n>  +K 8\n>  +svn:date\n>  +V 27\n>  +2008-04-02T09:13:03.170863Z\n>  +PROPS-END\n>  +\n>  +Node-path: name\n>  +Node-kind: dir\n>  +Node-action: add\n>  +Prop-content-length: 10\n>  +Content-length: 10\n>  +\n>  +PROPS-END\n>  +\n>  +\n>  +Node-path: name/a.txt\n>  +Node-kind: file\n>  +Node-action: add\n>  +Prop-content-length: 71\n>  +Text-content-length: 6\n>  +Text-content-md5: b1946ac92492d2347c6235b4d2611184\n>  +Content-length: 77\n>  +\n>  +K 13\n>  +svn:mime-type\n>  +V 10\n>  +text/plain\n>  +K 13\n>  +svn:eol-style\n>  +V 2\n>  +LF\n>  +PROPS-END\n>  +hello\n>  +\n>  +\n>  +Revision-number: 2\n>  +Prop-content-length: 109\n>  +Content-length: 109\n>  +\n>  +K 7\n>  +svn:log\n>  +V 7\n>  +renamed\n>  +K 10\n>  +svn:author\n>  +V 8\n>  +santhosh\n>  +K 8\n>  +svn:date\n>  +V 27\n>  +2008-04-02T09:14:22.952186Z\n>  +PROPS-END\n>  +\n>  +Node-path: newname\n>  +Node-kind: dir\n>  +Node-action: add\n>  +Node-copyfrom-rev: 1\n>  +Node-copyfrom-path: name\n>  +\n>  +\n>  +Node-path: name\n>  +Node-action: delete\n>  +\n>  +\n>  --\n>  1.5.5.rc3.dirty\n>\n"},{"id":"73799","messageId":"20080407070803.GA7736@soma","threadId":"12974","inReplyTo":"3bc895b00804030659p21dcae2av2cad3db41935fa4e@mail.gmail.com","subject":"[PATCH] git-svn: fix following renamed paths when tracking a single path","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-04-07T07:08:03Z","receivedAt":"2008-04-07T07:08:03Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"When using git-svn to follow only a single (empty) path per\nsvn-remote (i.e. not using --stdlayout), following the history\nof a renamed path was broken in\nc586879cdfa4f8181a14e953a9152a4639eef333.\n\nThis reverts the regression for the single (emtpy) path per\nsvn-remote case.\n\nTo avoid breaking the tests in a committed revision, this is an\naddendum to a patch originally submitted by\n\n  Santhosh Kumar Mani <santhoshmani@gmail.com>:\n  > git-svn: add test for renamed directory fetch\n  >\n  > This test tries to fetch a directory which had renames in the\n  > history from a SVN repository.\n\n  [ew: unneccesary dependency on the starting an HTTP server\n   removed from Santhosh's original test.]\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n\n Thanks Santhosh!\n\n git-svn.perl                         |    5 +-\n t/t9121-git-svn-fetch-renamed-dir.sh |   20 ++++++++\n t/t9121/renamed-dir.dump             |   90 ++++++++++++++++++++++++++++++++++\n 3 files changed, 113 insertions(+), 2 deletions(-)\n create mode 100755 t/t9121-git-svn-fetch-renamed-dir.sh\n create mode 100644 t/t9121/renamed-dir.dump\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 1b44cbe..81afb5c 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -2239,12 +2239,13 @@ sub find_parent_branch {\n \t\t# just grow a tail if we're not unique enough :x\n \t\t$ref_id .= '-' while find_ref($ref_id);\n \t\tprint STDERR \"Initializing parent: $ref_id\\n\";\n-\t\tmy ($u, $p) = ($new_url, '');\n+\t\tmy ($u, $p, $repo_id) = ($new_url, '', $ref_id);\n \t\tif ($u =~ s#^\\Q$url\\E(/|$)##) {\n \t\t\t$p = $u;\n \t\t\t$u = $url;\n+\t\t\t$repo_id = $self->{repo_id};\n \t\t}\n-\t\t$gs = Git::SVN->init($u, $p, $self->{repo_id}, $ref_id, 1);\n+\t\t$gs = Git::SVN->init($u, $p, $repo_id, $ref_id, 1);\n \t}\n \tmy ($r0, $parent) = $gs->find_rev_before($r, 1);\n \tif (!defined $r0 || !defined $parent) {\ndiff --git a/t/t9121-git-svn-fetch-renamed-dir.sh b/t/t9121-git-svn-fetch-renamed-dir.sh\nnew file mode 100755\nindex 0000000..5143ed6\n--- /dev/null\n+++ b/t/t9121-git-svn-fetch-renamed-dir.sh\n@@ -0,0 +1,20 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Santhosh Kumar Mani\n+\n+\n+test_description='git-svn can fetch renamed directories'\n+\n+. ./lib-git-svn.sh\n+\n+test_expect_success 'load repository with renamed directory' \"\n+\tsvnadmin load -q $rawsvnrepo < ../t9121/renamed-dir.dump\n+\t\"\n+\n+test_expect_success 'init and fetch repository' \"\n+\tgit svn init $svnrepo/newname &&\n+\tgit svn fetch\n+\t\"\n+\n+test_done\n+\ndiff --git a/t/t9121/renamed-dir.dump b/t/t9121/renamed-dir.dump\nnew file mode 100644\nindex 0000000..5f9127b\n--- /dev/null\n+++ b/t/t9121/renamed-dir.dump\n@@ -0,0 +1,90 @@\n+SVN-fs-dump-format-version: 2\n+\n+UUID: 06b9b3ad-f546-4fbe-8328-fcb4e6ef5c3f\n+\n+Revision-number: 0\n+Prop-content-length: 56\n+Content-length: 56\n+\n+K 8\n+svn:date\n+V 27\n+2008-04-02T09:11:59.778557Z\n+PROPS-END\n+\n+Revision-number: 1\n+Prop-content-length: 117\n+Content-length: 117\n+\n+K 7\n+svn:log\n+V 14\n+initial import\n+K 10\n+svn:author\n+V 8\n+santhosh\n+K 8\n+svn:date\n+V 27\n+2008-04-02T09:13:03.170863Z\n+PROPS-END\n+\n+Node-path: name\n+Node-kind: dir\n+Node-action: add\n+Prop-content-length: 10\n+Content-length: 10\n+\n+PROPS-END\n+\n+\n+Node-path: name/a.txt\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 71\n+Text-content-length: 6\n+Text-content-md5: b1946ac92492d2347c6235b4d2611184\n+Content-length: 77\n+\n+K 13\n+svn:mime-type\n+V 10\n+text/plain\n+K 13\n+svn:eol-style\n+V 2\n+LF\n+PROPS-END\n+hello\n+\n+\n+Revision-number: 2\n+Prop-content-length: 109\n+Content-length: 109\n+\n+K 7\n+svn:log\n+V 7\n+renamed\n+K 10\n+svn:author\n+V 8\n+santhosh\n+K 8\n+svn:date\n+V 27\n+2008-04-02T09:14:22.952186Z\n+PROPS-END\n+\n+Node-path: newname\n+Node-kind: dir\n+Node-action: add\n+Node-copyfrom-rev: 1\n+Node-copyfrom-path: name\n+\n+\n+Node-path: name\n+Node-action: delete\n+\n+\n-- \nEric Wong\n"}]}