git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG/TEST] git-svn: fetch fails with deleted tag
@ 2010-08-07  5:36 David D. Kilzer
  2010-08-12  5:18 ` David D. Kilzer
  0 siblings, 1 reply; 3+ messages in thread
From: David D. Kilzer @ 2010-08-07  5:36 UTC (permalink / raw)
  To: git; +Cc: Eric Wong, David D. Kilzer

The attached test fails when fetching the svn repo:

    Checksum mismatch: ChangeLog 065854....
    expected: ce771b....
         got: 9563fd....

The issue seems to be that the tag was created, deleted and then
recreated from the same source revision but at different paths.

Any suggestions for how to work around or fix this would be
greatly appreciated.

Ironically, I made the original commits in the svn repo that I'm
trying to fetch.  And yes, the extra "trunk" directory on the
branch was intended--it's the style that was agreed upon at the
time.

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
---
 t/t9199-git-svn-deleted-tag.sh |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)
 create mode 100755 t/t9199-git-svn-deleted-tag.sh

diff --git a/t/t9199-git-svn-deleted-tag.sh b/t/t9199-git-svn-deleted-tag.sh
new file mode 100755
index 0000000..059cccd
--- /dev/null
+++ b/t/t9199-git-svn-deleted-tag.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+test_description='git svn fetch with deleted tag'
+
+. ./lib-git-svn.sh
+
+test_expect_success 'setup svn repo' '
+	mkdir -p import/trunk/SubDir &&
+	mkdir -p import/branches &&
+	mkdir -p import/tags &&
+	echo "base" > import/trunk/SubDir/ChangeLog &&
+	svn_cmd import -m "import for git svn" import "$svnrepo" &&
+	rm -rf import &&
+
+	svn_cmd mkdir --parents -m "create MyBranch directory" "$svnrepo/branches/MyBranch" &&
+	svn_cmd cp -m "create branch MyBranch" "$svnrepo/trunk" "$svnrepo/branches/MyBranch/trunk" &&
+
+	svn_cmd co "$svnrepo/trunk" svn_project &&
+	cd svn_project &&
+
+	echo "trunk change" >> SubDir/ChangeLog &&
+	svn_cmd ci -m "trunk change" SubDir/ChangeLog &&
+
+	svn_cmd switch "$svnrepo/branches/MyBranch/trunk" &&
+	echo "branch change" >> SubDir/ChangeLog &&
+	svn_cmd ci -m "branch change" SubDir/ChangeLog &&
+
+	cd .. &&
+	svn_cmd cp -m "create MyTag attempt 1" -r5 "$svnrepo/trunk/SubDir" "$svnrepo/tags/MyTag" &&
+	svn_cmd rm -m "delete MyTag attempt 1" "$svnrepo/tags/MyTag" &&
+	svn_cmd cp -m "create MyTag attempt 2" -r5 "$svnrepo/branches/MyBranch/trunk/SubDir" "$svnrepo/tags/MyTag"
+'
+
+test_expect_success 'fetch with deleted tag' '
+	git svn init --stdlayout "$svnrepo" git_project &&
+	cd git_project &&
+	git svn fetch
+'
+
+test_done
-- 
1.7.2.1.49.g98551

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [BUG/TEST] git-svn: fetch fails with deleted tag
  2010-08-07  5:36 [BUG/TEST] git-svn: fetch fails with deleted tag David D. Kilzer
@ 2010-08-12  5:18 ` David D. Kilzer
  2010-08-12  8:11   ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: David D. Kilzer @ 2010-08-12  5:18 UTC (permalink / raw)
  To: git; +Cc: Eric Wong, David D. Kilzer

On Fri, August 6, 2010 at 10:36:55 PM, David D. Kilzer wrote:

> The attached test fails when fetching the svn repo:
> 
>      Checksum mismatch: ChangeLog 065854....
>     expected:  ce771b....
>          got: 9563fd....
> 
> The issue  seems to be that the tag was created, deleted and then
> recreated from the  same source revision but at different paths.


I have a fix for this.  I hope to send it out by Friday for further review.

This bug affects svn tags that are created, deleted and recreated with the 
following criteria:

- Both tags have the same name (since the second one replaces the first one 
after it's deleted).
- Both tags were created from the same revision in the repository.
- Each tag used a different repository path, e.g., one was from trunk while the 
other was from a branch.
- [Optional] Both tags had a file with the same path name but different content.

If the optional fourth criteria is met, the checksum mismatch occurs and git-svn 
fails during import.

However, if only the first three criteria are met, git-svn actually creates a 
tag with the first (deleted) tag's content!  The second tag's content is never 
imported, leaving the user with a tag in git whose content doesn't match the 
latest tag in svn.

Dave

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG/TEST] git-svn: fetch fails with deleted tag
  2010-08-12  5:18 ` David D. Kilzer
@ 2010-08-12  8:11   ` Eric Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2010-08-12  8:11 UTC (permalink / raw)
  To: David D. Kilzer; +Cc: git

"David D. Kilzer" <ddkilzer@kilzer.net> wrote:
> On Fri, August 6, 2010 at 10:36:55 PM, David D. Kilzer wrote:
> > The attached test fails when fetching the svn repo:
> I have a fix for this.  I hope to send it out by Friday for further review.

Thanks for the update, David.  I took a short stab but didn't
come up with much.  I'll take a look at your patch this weekend

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-12  8:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-07  5:36 [BUG/TEST] git-svn: fetch fails with deleted tag David D. Kilzer
2010-08-12  5:18 ` David D. Kilzer
2010-08-12  8:11   ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).