git-svn: enable follow-parent functionality by default
authorEric Wong <normalperson@yhbt.net>
Fri, 9 Feb 2007 10:45:03 +0000 (02:45 -0800)
committerEric Wong <normalperson@yhbt.net>
Fri, 23 Feb 2007 08:57:11 +0000 (00:57 -0800)
--no-follow-parent disables and reverts it back to the old
default behavior of not following parents (if you don't care for
full history).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Documentation/git-svn.txt
git-svn.perl
t/t9104-git-svn-follow-parent.sh
index 2914042587ed82354e6cd7caa30e0cbf9b689aeb..50dc6ac8183cba4391aaad66449fb9fc236a6fbd 100644 (file)
@@ -311,7 +311,8 @@ for more information on using GIT_SVN_ID.
        This is especially helpful when we're tracking a directory
        that has been moved around within the repository, or if we
        started tracking a branch and never tracked the trunk it was
-       descended from.
+       descended from. This feature is enabled by default, use
+       --no-follow-parent to disable it.
 
 config key: svn.followparent
 
index c8a1df3651c7f9ebd02c2c850cb817a4cca1b1cd..b9bacc384edfa5be73e8c4449d47c761b7710d9c 100755 (executable)
@@ -57,11 +57,11 @@ BEGIN
        $_version,
        $_merge, $_strategy, $_dry_run,
        $_prefix);
-
+$Git::SVN::_follow_parent = 1;
 my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
                     'config-dir=s' => \$Git::SVN::Ra::config_dir,
                     'no-auth-cache' => \$Git::SVN::Prompt::_no_auth_cache );
-my %fc_opts = ( 'follow-parent|follow' => \$Git::SVN::_follow_parent,
+my %fc_opts = ( 'follow-parent|follow!' => \$Git::SVN::_follow_parent,
                'authors-file|A=s' => \$_authors,
                'repack:i' => \$Git::SVN::_repack,
                'no-metadata' => \$Git::SVN::_no_metadata,
index f5b7e5efe018a548ef54f9a6684d9fb584a89fb9..53f5a925ac60e8e5a48dd46bf36b77a2f5b0c467 100755 (executable)
@@ -3,7 +3,7 @@
 # Copyright (c) 2006 Eric Wong
 #
 
-test_description='git-svn --follow-parent fetching'
+test_description='git-svn fetching'
 . ./lib-git-svn.sh
 
 test_expect_success 'initialize repo' "
@@ -27,9 +27,9 @@ test_expect_success 'initialize repo' "
        cd ..
        "
 
-test_expect_success 'init and fetch --follow-parent a moved directory' "
+test_expect_success 'init and fetch a moved directory' "
        git-svn init -i thunk $svnrepo/thunk &&
-       git-svn fetch --follow-parent -i thunk &&
+       git-svn fetch -i thunk &&
        test \"\`git-rev-parse --verify refs/remotes/thunk@2\`\" \
            = \"\`git-rev-parse --verify refs/remotes/thunk~1\`\" &&
         test \"\`git-cat-file blob refs/remotes/thunk:readme |\
@@ -44,7 +44,7 @@ test_expect_success 'init and fetch from one svn-remote' "
           trunk:refs/remotes/svn/trunk &&
         git-repo-config --add svn-remote.svn.fetch \
           thunk:refs/remotes/svn/thunk &&
-        git-svn fetch --follow-parent -i svn/thunk &&
+        git-svn fetch -i svn/thunk &&
        test \"\`git-rev-parse --verify refs/remotes/svn/trunk\`\" \
            = \"\`git-rev-parse --verify refs/remotes/svn/thunk~1\`\" &&
         test \"\`git-cat-file blob refs/remotes/svn/thunk:readme |\
@@ -56,8 +56,8 @@ test_expect_success 'follow deleted parent' "
                -r2 $svnrepo/trunk $svnrepo/junk &&
         git-repo-config --add svn-remote.svn.fetch \
           junk:refs/remotes/svn/junk &&
-        git-svn fetch --follow-parent -i svn/thunk &&
-        git-svn fetch -i svn/junk --follow-parent &&
+        git-svn fetch -i svn/thunk &&
+        git-svn fetch -i svn/junk &&
         test -z \"\`git diff svn/junk svn/trunk\`\" &&
         test \"\`git merge-base svn/junk svn/trunk\`\" \
            = \"\`git rev-parse svn/trunk\`\"
@@ -69,7 +69,7 @@ test_expect_success 'follow larger parent' "
         svn import -m 'import a larger parent' import $svnrepo/larger-parent &&
         svn cp -m 'hi' $svnrepo/larger-parent $svnrepo/another-larger &&
         git-svn init -i larger $svnrepo/another-larger/trunk/thunk/bump/thud &&
-        git-svn fetch -i larger --follow-parent &&
+        git-svn fetch -i larger &&
         git-rev-parse --verify refs/remotes/larger &&
         git-rev-parse --verify \
            refs/remotes/larger-parent/trunk/thunk/bump/thud &&
@@ -91,7 +91,7 @@ test_expect_success 'follow higher-level parent' "
         svn mkdir -m 'new glob at top level' $svnrepo/glob &&
         svn mv -m 'move blob down a level' $svnrepo/blob $svnrepo/glob/blob &&
         git-svn init -i blob $svnrepo/glob/blob &&
-        git-svn fetch -i blob --follow-parent
+        git-svn fetch -i blob
         "
 
 test_expect_success 'follow deleted directory' "
@@ -128,7 +128,7 @@ test_expect_success 'follow-parent avoids deleting relevant info' "
        cd .. &&
        git-svn init -i r9270-t \
          $svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t &&
-       git-svn fetch -i r9270-t --follow-parent &&
+       git-svn fetch -i r9270-t &&
        test \`git rev-list r9270-t | wc -l\` -eq 2 &&
        test \"\`git ls-tree --name-only r9270-t~1\`\" = \
             \"\`git ls-tree --name-only r9270-t\`\"
@@ -138,7 +138,7 @@ test_expect_success "track initial change if it was only made to parent" "
        svn cp -m 'wheee!' $svnrepo/r9270/trunk $svnrepo/r9270/drunk &&
        git-svn init -i r9270-d \
          $svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t &&
-       git-svn fetch -i r9270-d --follow-parent &&
+       git-svn fetch -i r9270-d &&
        test \`git rev-list r9270-d | wc -l\` -eq 3 &&
        test \"\`git ls-tree --name-only r9270-t\`\" = \
             \"\`git ls-tree --name-only r9270-d\`\" &&
@@ -148,19 +148,19 @@ test_expect_success "track initial change if it was only made to parent" "
 
 test_expect_success "track multi-parent paths" "
        svn cp -m 'resurrect /glob' $svnrepo/r9270 $svnrepo/glob &&
-       git-svn multi-fetch --follow-parent &&
+       git-svn multi-fetch &&
        test \`git cat-file commit refs/remotes/glob | \
               grep '^parent ' | wc -l\` -eq 2
        "
 
 test_expect_success "multi-fetch continues to work" "
-       git-svn multi-fetch --follow-parent
+       git-svn multi-fetch
        "
 
 test_expect_success "multi-fetch works off a 'clean' repository" "
        rm -r $GIT_DIR/svn $GIT_DIR/refs/remotes $GIT_DIR/logs &&
        mkdir $GIT_DIR/svn &&
-       git-svn multi-fetch --follow-parent
+       git-svn multi-fetch
        "
 
 test_debug 'gitk --all &'