git-svn: add --follow-parent and --no-metadata options to fetch
--follow-parent:
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.
This relies on the SVN::* libraries to work. We can't
reliably parse path info from the svn command-line client
without relying on XML, so it's better just to have the SVN::*
libs installed.
This also removes oldvalue verification when calling update-ref
In SVN, branches can be deleted, and then recreated under the
same path as the original one with different ancestry
information, causing parent information to be mismatched /
misordered.
Also force the current ref, if existing, to be a parent,
regardless of whether or not it was specified.
--no-metadata:
This gets rid of the git-svn-id: lines at the end of every commit.
With this, you lose the ability to use the rebuild command. If
you ever lose your .git/svn/git-svn/.rev_db file, you won't be
able to fetch again, either. This is fine for one-shot imports.
Also fix some issues with multi-fetch --follow-parent that were
exposed while testing this. Additionally, repack checking is
simplified greatly.
git-svn log will not work on repositories using this, either.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28 06:39:13 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2006 Eric Wong
|
|
|
|
#
|
|
|
|
|
2008-09-08 14:02:08 +04:00
|
|
|
test_description='git svn fetching'
|
revisions API: have release_revisions() release "cmdline"
Extend the the release_revisions() function so that it frees the
"cmdline" in the "struct rev_info". This in combination with a
preceding change to free "commits" and "mailmap" means that we can
whitelist another test under "TEST_PASSES_SANITIZE_LEAK=true".
There was a proposal in [1] to do away with xstrdup()-ing this
add_rev_cmdline(), perhaps that would be worthwhile, but for now let's
just free() it.
We could also make that a "char *" in "struct rev_cmdline_entry"
itself, but since we own it let's expose it as a constant to outside
callers. I proposed that in [2] but have since changed my mind. See
14d30cdfc04 (ref-filter: fix memory leak in `free_array_item()`,
2019-07-10), c514c62a4fd (checkout: fix leak of non-existent branch
names, 2020-08-14) and other log history hits for "free((char *)" for
prior art.
This includes the tests we had false-positive passes on before my
6798b08e848 (perl Git.pm: don't ignore signalled failure in
_cmd_close(), 2022-02-01), now they pass for real.
Since there are 66 tests matching t/t[0-9]*git-svn*.sh it's easier to
list those that don't pass than to touch most of those 66. So let's
introduce a "TEST_FAILS_SANITIZE_LEAK=true", which if set in the tests
won't cause lib-git-svn.sh to set "TEST_PASSES_SANITIZE_LEAK=true.
This change also marks all the tests that we removed
"TEST_FAILS_SANITIZE_LEAK=true" from in an earlier commit due to
removing the UNLEAK() from cmd_format_patch(), we can now assert that
its API use doesn't leak any "struct rev_info" memory.
This change also made commit "t5503-tagfollow.sh" pass on current
master, but that would regress when combined with
ps/fetch-atomic-fixup's de004e848a9 (t5503: simplify setup of test
which exercises failure of backfill, 2022-03-03) (through no fault of
that topic, that change started using "git clone" in the test, which
has an outstanding leak). Let's leave that test out for now to avoid
in-flight semantic conflicts.
1. https://lore.kernel.org/git/YUj%2FgFRh6pwrZalY@carlos-mbp.lan/
2. https://lore.kernel.org/git/87o88obkb1.fsf@evledraar.gmail.com/
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-13 23:01:47 +03:00
|
|
|
|
git-svn: add --follow-parent and --no-metadata options to fetch
--follow-parent:
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.
This relies on the SVN::* libraries to work. We can't
reliably parse path info from the svn command-line client
without relying on XML, so it's better just to have the SVN::*
libs installed.
This also removes oldvalue verification when calling update-ref
In SVN, branches can be deleted, and then recreated under the
same path as the original one with different ancestry
information, causing parent information to be mismatched /
misordered.
Also force the current ref, if existing, to be a parent,
regardless of whether or not it was specified.
--no-metadata:
This gets rid of the git-svn-id: lines at the end of every commit.
With this, you lose the ability to use the rebuild command. If
you ever lose your .git/svn/git-svn/.rev_db file, you won't be
able to fetch again, either. This is fine for one-shot imports.
Also fix some issues with multi-fetch --follow-parent that were
exposed while testing this. Additionally, repack checking is
simplified greatly.
git-svn log will not work on repositories using this, either.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28 06:39:13 +04:00
|
|
|
. ./lib-git-svn.sh
|
|
|
|
|
2008-05-04 09:37:59 +04:00
|
|
|
test_expect_success 'initialize repo' '
|
git-svn: add --follow-parent and --no-metadata options to fetch
--follow-parent:
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.
This relies on the SVN::* libraries to work. We can't
reliably parse path info from the svn command-line client
without relying on XML, so it's better just to have the SVN::*
libs installed.
This also removes oldvalue verification when calling update-ref
In SVN, branches can be deleted, and then recreated under the
same path as the original one with different ancestry
information, causing parent information to be mismatched /
misordered.
Also force the current ref, if existing, to be a parent,
regardless of whether or not it was specified.
--no-metadata:
This gets rid of the git-svn-id: lines at the end of every commit.
With this, you lose the ability to use the rebuild command. If
you ever lose your .git/svn/git-svn/.rev_db file, you won't be
able to fetch again, either. This is fine for one-shot imports.
Also fix some issues with multi-fetch --follow-parent that were
exposed while testing this. Additionally, repack checking is
simplified greatly.
git-svn log will not work on repositories using this, either.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28 06:39:13 +04:00
|
|
|
mkdir import &&
|
2010-09-07 05:42:54 +04:00
|
|
|
(
|
|
|
|
cd import &&
|
|
|
|
mkdir -p trunk &&
|
|
|
|
echo hello >trunk/readme &&
|
|
|
|
svn_cmd import -m "initial" . "$svnrepo"
|
2010-09-06 22:39:54 +04:00
|
|
|
) &&
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd co "$svnrepo" wc &&
|
2010-09-07 05:42:54 +04:00
|
|
|
(
|
|
|
|
cd wc &&
|
|
|
|
echo world >>trunk/readme &&
|
|
|
|
poke trunk/readme &&
|
|
|
|
svn_cmd commit -m "another commit" &&
|
|
|
|
svn_cmd up &&
|
|
|
|
svn_cmd mv trunk thunk &&
|
|
|
|
echo goodbye >>thunk/readme &&
|
|
|
|
poke thunk/readme &&
|
|
|
|
svn_cmd commit -m "bye now"
|
2010-09-06 22:39:54 +04:00
|
|
|
)
|
2008-05-04 09:37:59 +04:00
|
|
|
'
|
git-svn: add --follow-parent and --no-metadata options to fetch
--follow-parent:
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.
This relies on the SVN::* libraries to work. We can't
reliably parse path info from the svn command-line client
without relying on XML, so it's better just to have the SVN::*
libs installed.
This also removes oldvalue verification when calling update-ref
In SVN, branches can be deleted, and then recreated under the
same path as the original one with different ancestry
information, causing parent information to be mismatched /
misordered.
Also force the current ref, if existing, to be a parent,
regardless of whether or not it was specified.
--no-metadata:
This gets rid of the git-svn-id: lines at the end of every commit.
With this, you lose the ability to use the rebuild command. If
you ever lose your .git/svn/git-svn/.rev_db file, you won't be
able to fetch again, either. This is fine for one-shot imports.
Also fix some issues with multi-fetch --follow-parent that were
exposed while testing this. Additionally, repack checking is
simplified greatly.
git-svn log will not work on repositories using this, either.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28 06:39:13 +04:00
|
|
|
|
2008-05-04 09:37:59 +04:00
|
|
|
test_expect_success 'init and fetch a moved directory' '
|
2008-09-08 14:02:08 +04:00
|
|
|
git svn init --minimize-url -i thunk "$svnrepo"/thunk &&
|
|
|
|
git svn fetch -i thunk &&
|
2016-01-12 13:45:11 +03:00
|
|
|
test "$(git rev-parse --verify refs/remotes/thunk@2)" \
|
|
|
|
= "$(git rev-parse --verify refs/remotes/thunk~1)" &&
|
2018-03-27 20:31:37 +03:00
|
|
|
git cat-file blob refs/remotes/thunk:readme >actual &&
|
|
|
|
test "$(sed -n -e "3p" actual)" = goodbye &&
|
2016-01-12 13:45:11 +03:00
|
|
|
test -z "$(git config --get svn-remote.svn.fetch \
|
|
|
|
"^trunk:refs/remotes/thunk@2$")"
|
2008-05-04 09:37:59 +04:00
|
|
|
'
|
git-svn: add --follow-parent and --no-metadata options to fetch
--follow-parent:
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.
This relies on the SVN::* libraries to work. We can't
reliably parse path info from the svn command-line client
without relying on XML, so it's better just to have the SVN::*
libs installed.
This also removes oldvalue verification when calling update-ref
In SVN, branches can be deleted, and then recreated under the
same path as the original one with different ancestry
information, causing parent information to be mismatched /
misordered.
Also force the current ref, if existing, to be a parent,
regardless of whether or not it was specified.
--no-metadata:
This gets rid of the git-svn-id: lines at the end of every commit.
With this, you lose the ability to use the rebuild command. If
you ever lose your .git/svn/git-svn/.rev_db file, you won't be
able to fetch again, either. This is fine for one-shot imports.
Also fix some issues with multi-fetch --follow-parent that were
exposed while testing this. Additionally, repack checking is
simplified greatly.
git-svn log will not work on repositories using this, either.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28 06:39:13 +04:00
|
|
|
|
2008-05-04 09:37:59 +04:00
|
|
|
test_expect_success 'init and fetch from one svn-remote' '
|
2023-05-20 19:13:56 +03:00
|
|
|
git config svn-remote.svn.url "$svnrepo" &&
|
|
|
|
git config --add svn-remote.svn.fetch \
|
|
|
|
trunk:refs/remotes/svn/trunk &&
|
|
|
|
git config --add svn-remote.svn.fetch \
|
|
|
|
thunk:refs/remotes/svn/thunk &&
|
|
|
|
git svn fetch -i svn/thunk &&
|
2016-01-12 13:45:11 +03:00
|
|
|
test "$(git rev-parse --verify refs/remotes/svn/trunk)" \
|
2023-05-20 19:13:56 +03:00
|
|
|
= "$(git rev-parse --verify refs/remotes/svn/thunk~1)" &&
|
2018-03-27 20:31:37 +03:00
|
|
|
git cat-file blob refs/remotes/svn/thunk:readme >actual &&
|
|
|
|
test "$(sed -n -e "3p" actual)" = goodbye
|
2023-05-20 19:13:56 +03:00
|
|
|
'
|
2007-01-22 22:44:57 +03:00
|
|
|
|
2008-05-04 09:37:59 +04:00
|
|
|
test_expect_success 'follow deleted parent' '
|
2023-05-20 19:13:56 +03:00
|
|
|
(svn_cmd cp -m "resurrecting trunk as junk" \
|
|
|
|
"$svnrepo"/trunk@2 "$svnrepo"/junk ||
|
|
|
|
svn cp -m "resurrecting trunk as junk" \
|
|
|
|
-r2 "$svnrepo"/trunk "$svnrepo"/junk) &&
|
|
|
|
git config --add svn-remote.svn.fetch \
|
|
|
|
junk:refs/remotes/svn/junk &&
|
|
|
|
git svn fetch -i svn/thunk &&
|
|
|
|
git svn fetch -i svn/junk &&
|
2016-01-12 13:45:11 +03:00
|
|
|
test -z "$(git diff svn/junk svn/trunk)" &&
|
|
|
|
test "$(git merge-base svn/junk svn/trunk)" \
|
2023-05-20 19:13:56 +03:00
|
|
|
= "$(git rev-parse svn/trunk)"
|
|
|
|
'
|
2007-01-23 02:22:50 +03:00
|
|
|
|
2008-05-04 09:37:59 +04:00
|
|
|
test_expect_success 'follow larger parent' '
|
2023-05-20 19:13:56 +03:00
|
|
|
mkdir -p import/trunk/thunk/bump/thud &&
|
|
|
|
echo hi > import/trunk/thunk/bump/thud/file &&
|
|
|
|
svn import -m "import a larger parent" import "$svnrepo"/larger-parent &&
|
|
|
|
svn cp -m "hi" "$svnrepo"/larger-parent "$svnrepo"/another-larger &&
|
|
|
|
git svn init --minimize-url -i larger \
|
|
|
|
"$svnrepo"/larger-parent/trunk/thunk/bump/thud &&
|
|
|
|
git svn fetch -i larger &&
|
2015-03-20 17:32:56 +03:00
|
|
|
git svn init --minimize-url -i larger-parent \
|
2023-05-20 19:13:56 +03:00
|
|
|
"$svnrepo"/another-larger/trunk/thunk/bump/thud &&
|
2015-03-20 17:32:56 +03:00
|
|
|
git svn fetch -i larger-parent &&
|
2023-05-20 19:13:56 +03:00
|
|
|
git rev-parse --verify refs/remotes/larger &&
|
|
|
|
git rev-parse --verify \
|
|
|
|
refs/remotes/larger-parent &&
|
2016-01-12 13:45:11 +03:00
|
|
|
test "$(git merge-base \
|
2015-03-20 17:32:56 +03:00
|
|
|
refs/remotes/larger-parent \
|
2016-01-12 13:45:11 +03:00
|
|
|
refs/remotes/larger)" = \
|
2023-05-20 19:13:56 +03:00
|
|
|
"$(git rev-parse refs/remotes/larger)"
|
|
|
|
'
|
2007-01-24 13:16:25 +03:00
|
|
|
|
2008-05-04 09:37:59 +04:00
|
|
|
test_expect_success 'follow higher-level parent' '
|
2010-09-07 05:42:54 +04:00
|
|
|
svn mkdir -m "follow higher-level parent" "$svnrepo"/blob &&
|
|
|
|
svn co "$svnrepo"/blob blob &&
|
|
|
|
(
|
|
|
|
cd blob &&
|
|
|
|
echo hi > hi &&
|
|
|
|
svn add hi &&
|
2010-09-06 22:39:54 +04:00
|
|
|
svn commit -m "hihi"
|
2010-09-07 05:42:54 +04:00
|
|
|
) &&
|
|
|
|
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 --minimize-url -i blob "$svnrepo"/glob/blob &&
|
2008-09-08 14:02:08 +04:00
|
|
|
git svn fetch -i blob
|
2008-05-04 09:37:59 +04:00
|
|
|
'
|
2007-01-25 21:52:36 +03:00
|
|
|
|
2008-05-04 09:37:59 +04:00
|
|
|
test_expect_success 'follow deleted directory' '
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd mv -m "bye!" "$svnrepo"/glob/blob/hi "$svnrepo"/glob/blob/bye &&
|
|
|
|
svn_cmd rm -m "remove glob" "$svnrepo"/glob &&
|
2008-09-08 14:02:08 +04:00
|
|
|
git svn init --minimize-url -i glob "$svnrepo"/glob &&
|
|
|
|
git svn fetch -i glob &&
|
2016-01-12 13:45:11 +03:00
|
|
|
test "$(git cat-file blob refs/remotes/glob:blob/bye)" = hi &&
|
2018-03-27 20:31:37 +03:00
|
|
|
git ls-tree refs/remotes/glob >actual &&
|
|
|
|
test_line_count = 1 actual
|
2008-05-04 09:37:59 +04:00
|
|
|
'
|
2007-01-26 02:44:54 +03:00
|
|
|
|
2007-01-28 15:59:05 +03:00
|
|
|
# ref: r9270 of the Subversion repository: (http://svn.collab.net/repos/svn)
|
|
|
|
# in trunk/subversion/bindings/swig/perl
|
2008-05-04 09:37:59 +04:00
|
|
|
test_expect_success 'follow-parent avoids deleting relevant info' '
|
2007-01-28 15:59:05 +03:00
|
|
|
mkdir -p import/trunk/subversion/bindings/swig/perl/t &&
|
|
|
|
for i in a b c ; do \
|
2008-05-04 09:37:59 +04:00
|
|
|
echo $i > import/trunk/subversion/bindings/swig/perl/$i.pm &&
|
2021-12-09 08:11:15 +03:00
|
|
|
echo _$i > import/trunk/subversion/bindings/swig/perl/t/$i.t || return 1
|
2007-01-28 15:59:05 +03:00
|
|
|
done &&
|
2008-05-04 09:37:59 +04:00
|
|
|
echo "bad delete test" > \
|
2007-01-28 15:59:05 +03:00
|
|
|
import/trunk/subversion/bindings/swig/perl/t/larger-parent &&
|
2008-05-04 09:37:59 +04:00
|
|
|
echo "bad delete test 2" > \
|
2007-01-28 15:59:05 +03:00
|
|
|
import/trunk/subversion/bindings/swig/perl/another-larger &&
|
2010-09-07 05:42:54 +04:00
|
|
|
(
|
|
|
|
cd import &&
|
|
|
|
svn import -m "r9270 test" . "$svnrepo"/r9270
|
2010-09-06 22:39:54 +04:00
|
|
|
) &&
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd co "$svnrepo"/r9270/trunk/subversion/bindings/swig/perl r9270 &&
|
2010-09-07 05:42:54 +04:00
|
|
|
(
|
|
|
|
cd r9270 &&
|
|
|
|
svn mkdir native &&
|
|
|
|
svn mv t native/t &&
|
|
|
|
for i in a b c
|
|
|
|
do
|
2021-12-09 08:11:15 +03:00
|
|
|
svn mv $i.pm native/$i.pm || return 1
|
2010-09-07 05:42:54 +04:00
|
|
|
done &&
|
|
|
|
echo z >>native/t/c.t &&
|
|
|
|
poke native/t/c.t &&
|
|
|
|
svn commit -m "reorg test"
|
2010-09-06 22:39:54 +04:00
|
|
|
) &&
|
2008-09-08 14:02:08 +04:00
|
|
|
git svn init --minimize-url -i r9270-t \
|
2008-05-04 09:37:59 +04:00
|
|
|
"$svnrepo"/r9270/trunk/subversion/bindings/swig/perl/native/t &&
|
2008-09-08 14:02:08 +04:00
|
|
|
git svn fetch -i r9270-t &&
|
2016-01-12 13:45:11 +03:00
|
|
|
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)"
|
2008-05-04 09:37:59 +04:00
|
|
|
'
|
2007-01-28 15:59:05 +03:00
|
|
|
|
2008-05-04 09:37:59 +04:00
|
|
|
test_expect_success "track initial change if it was only made to parent" '
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd cp -m "wheee!" "$svnrepo"/r9270/trunk "$svnrepo"/r9270/drunk &&
|
2008-09-08 14:02:08 +04:00
|
|
|
git svn init --minimize-url -i r9270-d \
|
2008-05-04 09:37:59 +04:00
|
|
|
"$svnrepo"/r9270/drunk/subversion/bindings/swig/perl/native/t &&
|
2008-09-08 14:02:08 +04:00
|
|
|
git svn fetch -i r9270-d &&
|
2016-01-12 13:45:11 +03:00
|
|
|
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)" &&
|
|
|
|
test "$(git rev-parse r9270-t)" = \
|
|
|
|
"$(git rev-parse r9270-d~1)"
|
2008-05-04 09:37:59 +04:00
|
|
|
'
|
2007-01-30 11:35:18 +03:00
|
|
|
|
2008-12-08 16:31:31 +03:00
|
|
|
test_expect_success "follow-parent is atomic" '
|
2020-06-20 01:39:38 +03:00
|
|
|
record_size=$(($(test_oid rawsz) + 4)) &&
|
2008-12-08 16:31:31 +03:00
|
|
|
(
|
|
|
|
cd wc &&
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd up &&
|
|
|
|
svn_cmd mkdir stunk &&
|
2008-12-08 16:31:31 +03:00
|
|
|
echo "trunk stunk" > stunk/readme &&
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd add stunk/readme &&
|
|
|
|
svn_cmd ci -m "trunk stunk" &&
|
2008-12-08 16:31:31 +03:00
|
|
|
echo "stunk like junk" >> stunk/readme &&
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd ci -m "really stunk" &&
|
2008-12-08 16:31:31 +03:00
|
|
|
echo "stink stank stunk" >> stunk/readme &&
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd ci -m "even the grinch agrees"
|
2008-12-08 16:31:31 +03:00
|
|
|
) &&
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd copy -m "stunk flunked" "$svnrepo"/stunk "$svnrepo"/flunk &&
|
2008-12-08 16:31:31 +03:00
|
|
|
{ svn cp -m "early stunk flunked too" \
|
|
|
|
"$svnrepo"/stunk@17 "$svnrepo"/flunked ||
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd cp -m "early stunk flunked too" \
|
2008-12-08 16:31:31 +03:00
|
|
|
-r17 "$svnrepo"/stunk "$svnrepo"/flunked; } &&
|
|
|
|
git svn init --minimize-url -i stunk "$svnrepo"/stunk &&
|
|
|
|
git svn fetch -i stunk &&
|
|
|
|
git update-ref refs/remotes/flunk@18 refs/remotes/stunk~2 &&
|
|
|
|
git update-ref -d refs/remotes/stunk &&
|
|
|
|
git config --unset svn-remote.svn.fetch stunk &&
|
2009-08-12 07:14:27 +04:00
|
|
|
mkdir -p "$GIT_DIR"/svn/refs/remotes/flunk@18 &&
|
|
|
|
rev_map=$(cd "$GIT_DIR"/svn/refs/remotes/stunk && ls .rev_map*) &&
|
|
|
|
dd if="$GIT_DIR"/svn/refs/remotes/stunk/$rev_map \
|
2020-06-20 01:39:38 +03:00
|
|
|
of="$GIT_DIR"/svn/refs/remotes/flunk@18/$rev_map bs=$record_size count=1 &&
|
2009-08-12 07:14:27 +04:00
|
|
|
rm -rf "$GIT_DIR"/svn/refs/remotes/stunk &&
|
2008-12-08 16:31:31 +03:00
|
|
|
git svn init --minimize-url -i flunk "$svnrepo"/flunk &&
|
|
|
|
git svn fetch -i flunk &&
|
|
|
|
git svn init --minimize-url -i stunk "$svnrepo"/stunk &&
|
|
|
|
git svn fetch -i stunk &&
|
|
|
|
git svn init --minimize-url -i flunked "$svnrepo"/flunked &&
|
2010-10-31 04:46:54 +03:00
|
|
|
git svn fetch -i flunked &&
|
2016-01-12 13:45:11 +03:00
|
|
|
test "$(git rev-parse --verify refs/remotes/flunk@18)" \
|
|
|
|
= "$(git rev-parse --verify refs/remotes/stunk)" &&
|
|
|
|
test "$(git rev-parse --verify refs/remotes/flunk~1)" \
|
|
|
|
= "$(git rev-parse --verify refs/remotes/stunk)" &&
|
|
|
|
test "$(git rev-parse --verify refs/remotes/flunked~1)" \
|
|
|
|
= "$(git rev-parse --verify refs/remotes/stunk~1)"
|
2008-12-08 16:31:31 +03:00
|
|
|
'
|
|
|
|
|
2008-05-04 09:37:59 +04:00
|
|
|
test_expect_success "track multi-parent paths" '
|
2009-05-08 12:06:16 +04:00
|
|
|
svn_cmd cp -m "resurrect /glob" "$svnrepo"/r9270 "$svnrepo"/glob &&
|
2008-09-08 14:02:08 +04:00
|
|
|
git svn multi-fetch &&
|
2018-03-27 20:31:37 +03:00
|
|
|
git cat-file commit refs/remotes/glob >actual &&
|
|
|
|
grep "^parent " actual >actual2 &&
|
|
|
|
test_line_count = 2 actual2
|
2008-05-04 09:37:59 +04:00
|
|
|
'
|
2007-02-09 12:28:30 +03:00
|
|
|
|
2007-01-31 13:45:50 +03:00
|
|
|
test_expect_success "multi-fetch continues to work" "
|
2008-09-08 14:02:08 +04:00
|
|
|
git svn multi-fetch
|
2007-01-31 13:45:50 +03:00
|
|
|
"
|
|
|
|
|
2008-05-04 09:37:59 +04:00
|
|
|
test_expect_success "multi-fetch works off a 'clean' repository" '
|
2018-06-01 08:08:33 +03:00
|
|
|
rm -rf "$GIT_DIR/svn" &&
|
|
|
|
git for-each-ref --format="option no-deref%0adelete %(refname)" refs/remotes |
|
|
|
|
git update-ref --stdin &&
|
2018-05-23 08:25:17 +03:00
|
|
|
git reflog expire --all --expire=all &&
|
2008-05-04 09:37:59 +04:00
|
|
|
mkdir "$GIT_DIR/svn" &&
|
2008-09-08 14:02:08 +04:00
|
|
|
git svn multi-fetch
|
2008-05-04 09:37:59 +04:00
|
|
|
'
|
2007-01-31 13:45:50 +03:00
|
|
|
|
git-svn: add --follow-parent and --no-metadata options to fetch
--follow-parent:
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.
This relies on the SVN::* libraries to work. We can't
reliably parse path info from the svn command-line client
without relying on XML, so it's better just to have the SVN::*
libs installed.
This also removes oldvalue verification when calling update-ref
In SVN, branches can be deleted, and then recreated under the
same path as the original one with different ancestry
information, causing parent information to be mismatched /
misordered.
Also force the current ref, if existing, to be a parent,
regardless of whether or not it was specified.
--no-metadata:
This gets rid of the git-svn-id: lines at the end of every commit.
With this, you lose the ability to use the rebuild command. If
you ever lose your .git/svn/git-svn/.rev_db file, you won't be
able to fetch again, either. This is fine for one-shot imports.
Also fix some issues with multi-fetch --follow-parent that were
exposed while testing this. Additionally, repack checking is
simplified greatly.
git-svn log will not work on repositories using this, either.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28 06:39:13 +04:00
|
|
|
test_debug 'gitk --all &'
|
|
|
|
|
|
|
|
test_done
|