git-svn: correctly track revisions made to deleted branches

git-svn has never been able to handle deleted branches very well
because svn_ra_get_log() is all-or-nothing, meaning that if the
max revision passed to it does not contain the path we're
tracking, we miss all the revisions in the repository.

Branches fetched using --follow-parent still do this
sub-optimally (will be fixed soon).  --follow-parent will soon
become the default, so we will assume that when using get_log();

We will also avoid tracking revprops for revisions with no
path-related changes since otherwise we just end up pulling
logs to paths we don't care about.

Also added a test for this to t9104-git-svn-follow-parent.sh and
correctly commit the log message in the preceeding test (which
conflicted with a filename).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
This commit is contained in:
Eric Wong
2007-01-25 15:44:54 -08:00
parent 97f6987afa
commit e5a0b240fc
2 changed files with 34 additions and 23 deletions

View File

@ -85,7 +85,7 @@ test_expect_success 'follow higher-level parent' "
cd blob &&
echo hi > hi &&
svn add hi &&
svn commit -m 'hi' &&
svn commit -m 'hihi' &&
cd ..
svn mkdir -m 'new glob at top level' $svnrepo/glob &&
svn mv -m 'move blob down a level' $svnrepo/blob $svnrepo/glob/blob &&
@ -93,6 +93,15 @@ test_expect_success 'follow higher-level parent' "
git-svn fetch -i blob --follow-parent
"
test_expect_success 'follow deleted directory' "
svn mv -m 'bye!' $svnrepo/glob/blob/hi $svnrepo/glob/blob/bye&&
svn rm -m 'remove glob' $svnrepo/glob &&
git-svn init -i glob $svnrepo/glob &&
git-svn fetch -i glob &&
test \"\`git cat-file blob refs/remotes/glob~1:blob/bye\`\" = hi &&
test -z \"\`git ls-tree -z refs/remotes/glob\`\"
"
test_debug 'gitk --all &'
test_done