{"thread":{"id":"17702","subject":"git-svn: broken symlink check fetches wrong revision from svn (possible regression)","startedAt":"2009-02-10T14:51:16Z","lastAt":"2009-02-10T14:51:16Z","messageCount":1,"participants":["Anton Gyllenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"104018","messageId":"83dfc36c0902100651s531ca5a2x10b40ee305d4678d@mail.gmail.com","threadId":"17702","inReplyTo":null,"subject":"git-svn: broken symlink check fetches wrong revision from svn (possible regression)","fromName":"Anton Gyllenberg","fromEmail":"anton@iki.fi","sentAt":"2009-02-10T14:51:16Z","receivedAt":"2009-02-10T14:51:16Z","isPatch":false,"sender":{"key":"anton@iki.fi","avatar":null},"body":"The check for broken symlinks introduced in dbc6c74d0 \"git-svn: handle\nempty files marked as symlinks in SVN\" changed git-svn fetch behavior\nfor a real-life repository I need to access. It doesn't have broken\nsymlinks. The repository had a branch deleted and recreated off of a\ndifferent branch point. The new branch point has empty files not in\nthe original branch point. It seems the symlink check\n_mark_empty_symlinks fetches the wrong SVN revision of the empty files\nin this special case. git-svn fetch stops with an error like\n\nFilesystem has no item: File not found: revision 4, path\n'/branches/branch-c/b1' at git-svn line 3288\n\nWhich is true, there is no such file, but in my case the empty file b1\nis in revision 6 (new branch-c copied from branch-b@r5 where the\noriginal branch-c was deleted), not revision 4 (original branch-c\ncopied from trunk in r4).\n\n\nI used the following shell script to produce a test repository that\ndisplays the symptom:\n#!/bin/bash\n\nSVNREPO=file:///$PWD/test.db\nsvnadmin create test.db\nsvn co $SVNREPO testreposvn\ncd testreposvn\nmkdir trunk branches\nsvn add trunk branches\nsvn ci -m \"init standard layout\"\nsvn cp trunk branches/branch-b\nsvn ci -m 'branch-b off trunk'\ntouch branches/branch-b/b1\nsvn add branches/branch-b/b1\nsvn ci -m 'add empty file b1'\nsvn cp -m 'branch-c' $SVNREPO/{trunk,branches/branch-c}\nsvn del -m 'oops, wrong branchpoint' $SVNREPO/branches/branch-c\nsvn cp -m 'branch-c off of branch-b' $SVNREPO/branches/{branch-b,branch-c}\n\n----\nThis leaves the svn repository in ./test.db, svn working copy in\n./testreposvn. And the problem:\n\n$ git init -s file:///$PWD/test.db testrepogit\nInitialized empty Git repository in /tmp/test/testrepogit/.git/\n$ cd testrepogit\n$ git --version\ngit version 1.6.2.rc0\n$ git svn fetch\nr1 = ff1aea02906c970caa49055db564158d6911a512 (trunk)\nFound possible branch point: file:////tmp/test/test.db/trunk =>\nfile:////tmp/test/test.db/branches/branch-b, 1\nFound branch parent: (branch-b) ff1aea02906c970caa49055db564158d6911a512\nFollowing parent with do_switch\nSuccessfully followed parent\nr2 = d0f256cbf64dc1e49597e54a55538758ca70d65f (branch-b)\n\tA\tb1\nr3 = 48d511b172a95a609d5e10f1275664e6b4ca4e62 (branch-b)\nFound possible branch point: file:////tmp/test/test.db/trunk =>\nfile:////tmp/test/test.db/branches/branch-c, 3\nFound branch parent: (branch-c) ff1aea02906c970caa49055db564158d6911a512\nFollowing parent with do_switch\nSuccessfully followed parent\nr4 = 57923c03b201b2dbbb9d52b81e198a1a78b9de44 (branch-c)\nFound possible branch point:\nfile:////tmp/test/test.db/branches/branch-b =>\nfile:////tmp/test/test.db/branches/branch-c, 5\nFound branch parent: (branch-c) 48d511b172a95a609d5e10f1275664e6b4ca4e62\nIndex mismatch: 934e48f4addc4882a9b7b99615348569d531c873 !=\n4b825dc642cb6eb9a060e54bf8d69288fbee4904\nrereading 48d511b172a95a609d5e10f1275664e6b4ca4e62\nFollowing parent with do_switch\nFilesystem has no item: File not found: revision 4, path\n'/branches/branch-c/b1' at git-svn line 3288\n\n----\n\nBreaking out of _mark_empty_symlinks() before SVN access makes the\ngit-svn fetch complete without errors but does record the original\nbranch-c as parent which I did not expect but it kind of makes sense.\nI tried to figure out where the revision to fetch in\n_mark_empty_symlinks() comes from but eventually gave up as I am not\nthat fluent in perl.\n\nAnton\n"}]}