提交 5b85143b 编写于 作者: J Junio C Hamano

Merge branch 'ew/svn-pm'

* ew/svn-pm:
  git-svn: rename 'commit' command to 'set-tree'
  git-svn: remove support for the svn command-line client
  git-svn: convert to using Git.pm
...@@ -64,7 +64,7 @@ manually joining branches on commit. ...@@ -64,7 +64,7 @@ manually joining branches on commit.
against the latest changes in the SVN repository. against the latest changes in the SVN repository.
An optional command-line argument may be specified as an An optional command-line argument may be specified as an
alternative to HEAD. alternative to HEAD.
This is advantageous over 'commit' (below) because it produces This is advantageous over 'set-tree' (below) because it produces
cleaner, more linear history. cleaner, more linear history.
'log':: 'log'::
...@@ -89,7 +89,7 @@ manually joining branches on commit. ...@@ -89,7 +89,7 @@ manually joining branches on commit.
Any other arguments are passed directly to `git log' Any other arguments are passed directly to `git log'
'commit':: 'set-tree'::
You should consider using 'dcommit' instead of this command. You should consider using 'dcommit' instead of this command.
Commit specified commit or tree objects to SVN. This relies on Commit specified commit or tree objects to SVN. This relies on
your imported fetch data being up-to-date. This makes your imported fetch data being up-to-date. This makes
...@@ -172,7 +172,7 @@ This can allow you to make partial mirrors when running fetch. ...@@ -172,7 +172,7 @@ This can allow you to make partial mirrors when running fetch.
-:: -::
--stdin:: --stdin::
Only used with the 'commit' command. Only used with the 'set-tree' command.
Read a list of commits from stdin and commit them in reverse Read a list of commits from stdin and commit them in reverse
order. Only the leading sha1 is read from each line, so order. Only the leading sha1 is read from each line, so
...@@ -180,7 +180,7 @@ git-rev-list --pretty=oneline output can be used. ...@@ -180,7 +180,7 @@ git-rev-list --pretty=oneline output can be used.
--rmdir:: --rmdir::
Only used with the 'dcommit', 'commit' and 'commit-diff' commands. Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands.
Remove directories from the SVN tree if there are no files left Remove directories from the SVN tree if there are no files left
behind. SVN can version empty directories, and they are not behind. SVN can version empty directories, and they are not
...@@ -193,7 +193,7 @@ repo-config key: svn.rmdir ...@@ -193,7 +193,7 @@ repo-config key: svn.rmdir
-e:: -e::
--edit:: --edit::
Only used with the 'dcommit', 'commit' and 'commit-diff' commands. Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands.
Edit the commit message before committing to SVN. This is off by Edit the commit message before committing to SVN. This is off by
default for objects that are commits, and forced on when committing default for objects that are commits, and forced on when committing
...@@ -204,7 +204,7 @@ repo-config key: svn.edit ...@@ -204,7 +204,7 @@ repo-config key: svn.edit
-l<num>:: -l<num>::
--find-copies-harder:: --find-copies-harder::
Only used with the 'dcommit', 'commit' and 'commit-diff' commands. Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands.
They are both passed directly to git-diff-tree see They are both passed directly to git-diff-tree see
gitlink:git-diff-tree[1] for more information. gitlink:git-diff-tree[1] for more information.
...@@ -276,7 +276,7 @@ ADVANCED OPTIONS ...@@ -276,7 +276,7 @@ ADVANCED OPTIONS
-b<refname>:: -b<refname>::
--branch <refname>:: --branch <refname>::
Used with 'fetch', 'dcommit' or 'commit'. Used with 'fetch', 'dcommit' or 'set-tree'.
This can be used to join arbitrary git branches to remotes/git-svn This can be used to join arbitrary git branches to remotes/git-svn
on new commits where the tree object is equivalent. on new commits where the tree object is equivalent.
...@@ -392,11 +392,11 @@ REBASE VS. PULL ...@@ -392,11 +392,11 @@ REBASE VS. PULL
--------------- ---------------
Originally, git-svn recommended that the remotes/git-svn branch be Originally, git-svn recommended that the remotes/git-svn branch be
pulled from. This is because the author favored 'git-svn commit B' pulled from. This is because the author favored 'git-svn set-tree B'
to commit a single head rather than the 'git-svn commit A..B' notation to commit a single head rather than the 'git-svn set-tree A..B' notation
to commit multiple commits. to commit multiple commits.
If you use 'git-svn commit A..B' to commit several diffs and you do not If you use 'git-svn set-tree A..B' to commit several diffs and you do not
have the latest remotes/git-svn merged into my-branch, you should use have the latest remotes/git-svn merged into my-branch, you should use
'git rebase' to update your work branch instead of 'git pull'. 'pull' 'git rebase' to update your work branch instead of 'git pull'. 'pull'
can cause non-linear history to be flattened when committing into SVN, can cause non-linear history to be flattened when committing into SVN,
......
此差异已折叠。
...@@ -23,13 +23,9 @@ clean: ...@@ -23,13 +23,9 @@ clean:
# we can test NO_OPTIMIZE_COMMITS independently of LC_ALL # we can test NO_OPTIMIZE_COMMITS independently of LC_ALL
full-svn-test: full-svn-test:
$(MAKE) $(TSVN) GIT_SVN_NO_LIB=0 GIT_SVN_DELTA_FETCH=1 \ $(MAKE) $(TSVN) GIT_SVN_DELTA_FETCH=1 \
GIT_SVN_NO_OPTIMIZE_COMMITS=1 LC_ALL=C GIT_SVN_NO_OPTIMIZE_COMMITS=1 LC_ALL=C
$(MAKE) $(TSVN) GIT_SVN_NO_LIB=1 GIT_SVN_NO_OPTIMIZE_COMMITS=1 LC_ALL=C $(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=0 LC_ALL=en_US.UTF-8
$(MAKE) $(TSVN) GIT_SVN_NO_LIB=1 GIT_SVN_NO_OPTIMIZE_COMMITS=0 \
LC_ALL=en_US.UTF-8
$(MAKE) $(TSVN) GIT_SVN_NO_LIB=0 GIT_SVN_NO_OPTIMIZE_COMMITS=0 \
LC_ALL=en_US.UTF-8
.PHONY: $(T) clean .PHONY: $(T) clean
.NOTPARALLEL: .NOTPARALLEL:
......
...@@ -7,17 +7,18 @@ then ...@@ -7,17 +7,18 @@ then
exit exit
fi fi
GIT_DIR=$PWD/.git perl -e 'use SVN::Core; $SVN::Core::VERSION gt "1.1.0" or die' >/dev/null 2>&1
GIT_SVN_DIR=$GIT_DIR/svn/git-svn
SVN_TREE=$GIT_SVN_DIR/svn-tree
perl -e 'use SVN::Core' >/dev/null 2>&1
if test $? -ne 0 if test $? -ne 0
then then
echo 'Perl SVN libraries not found, tests requiring those will be skipped' test_expect_success 'Perl SVN libraries not found, skipping test' :
GIT_SVN_NO_LIB=1 test_done
exit
fi fi
GIT_DIR=$PWD/.git
GIT_SVN_DIR=$GIT_DIR/svn/git-svn
SVN_TREE=$GIT_SVN_DIR/svn-tree
svnadmin >/dev/null 2>&1 svnadmin >/dev/null 2>&1
if test $? -ne 1 if test $? -ne 1
then then
......
...@@ -56,7 +56,7 @@ git update-index --add --remove dir/a/b/c/d/e/file dir/file file ...@@ -56,7 +56,7 @@ git update-index --add --remove dir/a/b/c/d/e/file dir/file file
git commit -m "$name" git commit -m "$name"
test_expect_success "$name" \ test_expect_success "$name" \
"git-svn commit --find-copies-harder --rmdir remotes/git-svn..mybranch && "git-svn set-tree --find-copies-harder --rmdir remotes/git-svn..mybranch &&
svn up $SVN_TREE && svn up $SVN_TREE &&
test -d $SVN_TREE/dir && test ! -d $SVN_TREE/dir/a" test -d $SVN_TREE/dir && test ! -d $SVN_TREE/dir/a"
...@@ -70,7 +70,7 @@ git update-index --add dir/file/file ...@@ -70,7 +70,7 @@ git update-index --add dir/file/file
git commit -m "$name" git commit -m "$name"
test_expect_failure "$name" \ test_expect_failure "$name" \
'git-svn commit --find-copies-harder --rmdir remotes/git-svn..mybranch' \ 'git-svn set-tree --find-copies-harder --rmdir remotes/git-svn..mybranch' \
|| true || true
...@@ -85,7 +85,7 @@ git update-index --add -- bar ...@@ -85,7 +85,7 @@ git update-index --add -- bar
git commit -m "$name" git commit -m "$name"
test_expect_failure "$name" \ test_expect_failure "$name" \
'git-svn commit --find-copies-harder --rmdir remotes/git-svn..mybranch2' \ 'git-svn set-tree --find-copies-harder --rmdir remotes/git-svn..mybranch2' \
|| true || true
...@@ -100,7 +100,7 @@ git-update-index --add bar/zzz/yyy ...@@ -100,7 +100,7 @@ git-update-index --add bar/zzz/yyy
git commit -m "$name" git commit -m "$name"
test_expect_failure "$name" \ test_expect_failure "$name" \
'git-svn commit --find-copies-harder --rmdir remotes/git-svn..mybranch3' \ 'git-svn set-tree --find-copies-harder --rmdir remotes/git-svn..mybranch3' \
|| true || true
...@@ -115,7 +115,7 @@ git update-index --add -- dir ...@@ -115,7 +115,7 @@ git update-index --add -- dir
git commit -m "$name" git commit -m "$name"
test_expect_failure "$name" \ test_expect_failure "$name" \
'git-svn commit --find-copies-harder --rmdir remotes/git-svn..mybranch4' \ 'git-svn set-tree --find-copies-harder --rmdir remotes/git-svn..mybranch4' \
|| true || true
...@@ -127,7 +127,7 @@ git update-index exec.sh ...@@ -127,7 +127,7 @@ git update-index exec.sh
git commit -m "$name" git commit -m "$name"
test_expect_success "$name" \ test_expect_success "$name" \
"git-svn commit --find-copies-harder --rmdir remotes/git-svn..mybranch5 && "git-svn set-tree --find-copies-harder --rmdir remotes/git-svn..mybranch5 &&
svn up $SVN_TREE && svn up $SVN_TREE &&
test ! -x $SVN_TREE/exec.sh" test ! -x $SVN_TREE/exec.sh"
...@@ -138,7 +138,7 @@ git update-index exec.sh ...@@ -138,7 +138,7 @@ git update-index exec.sh
git commit -m "$name" git commit -m "$name"
test_expect_success "$name" \ test_expect_success "$name" \
"git-svn commit --find-copies-harder --rmdir remotes/git-svn..mybranch5 && "git-svn set-tree --find-copies-harder --rmdir remotes/git-svn..mybranch5 &&
svn up $SVN_TREE && svn up $SVN_TREE &&
test -x $SVN_TREE/exec.sh" test -x $SVN_TREE/exec.sh"
...@@ -153,7 +153,7 @@ then ...@@ -153,7 +153,7 @@ then
git commit -m "$name" git commit -m "$name"
test_expect_success "$name" \ test_expect_success "$name" \
"git-svn commit --find-copies-harder --rmdir remotes/git-svn..mybranch5 && "git-svn set-tree --find-copies-harder --rmdir remotes/git-svn..mybranch5 &&
svn up $SVN_TREE && svn up $SVN_TREE &&
test -L $SVN_TREE/exec.sh" test -L $SVN_TREE/exec.sh"
...@@ -164,7 +164,7 @@ then ...@@ -164,7 +164,7 @@ then
git commit -m "$name" git commit -m "$name"
test_expect_success "$name" \ test_expect_success "$name" \
"git-svn commit --find-copies-harder --rmdir remotes/git-svn..mybranch5 && "git-svn set-tree --find-copies-harder --rmdir remotes/git-svn..mybranch5 &&
svn up $SVN_TREE && svn up $SVN_TREE &&
test -x $SVN_TREE/bar/zzz && test -x $SVN_TREE/bar/zzz &&
test -L $SVN_TREE/exec-2.sh" test -L $SVN_TREE/exec-2.sh"
...@@ -177,7 +177,7 @@ then ...@@ -177,7 +177,7 @@ then
git commit -m "$name" git commit -m "$name"
test_expect_success "$name" \ test_expect_success "$name" \
"git-svn commit --find-copies-harder --rmdir remotes/git-svn..mybranch5 && "git-svn set-tree --find-copies-harder --rmdir remotes/git-svn..mybranch5 &&
svn up $SVN_TREE && svn up $SVN_TREE &&
test -f $SVN_TREE/exec-2.sh && test -f $SVN_TREE/exec-2.sh &&
test ! -L $SVN_TREE/exec-2.sh && test ! -L $SVN_TREE/exec-2.sh &&
...@@ -192,7 +192,7 @@ then ...@@ -192,7 +192,7 @@ then
git update-index exec-2.sh git update-index exec-2.sh
git commit -m 'éï∏' git commit -m 'éï∏'
export LC_ALL="$GIT_SVN_LC_ALL" export LC_ALL="$GIT_SVN_LC_ALL"
test_expect_success "$name" "git-svn commit HEAD" test_expect_success "$name" "git-svn set-tree HEAD"
unset LC_ALL unset LC_ALL
else else
echo "UTF-8 locale not set, test skipped ($GIT_SVN_LC_ALL)" echo "UTF-8 locale not set, test skipped ($GIT_SVN_LC_ALL)"
...@@ -229,9 +229,7 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e ...@@ -229,9 +229,7 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e
tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4 tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4
EOF EOF
if test -z "$GIT_SVN_NO_LIB" || test "$GIT_SVN_NO_LIB" -eq 0; then echo tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 >> expected
echo tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 >> expected
fi
test_expect_success "$name" "diff -u a expected" test_expect_success "$name" "diff -u a expected"
......
...@@ -74,7 +74,7 @@ test_expect_success "$name" \ ...@@ -74,7 +74,7 @@ test_expect_success "$name" \
'git checkout -b mybranch remotes/git-svn && 'git checkout -b mybranch remotes/git-svn &&
echo Hi again >> kw.c && echo Hi again >> kw.c &&
git commit -a -m "test keywoards ignoring" && git commit -a -m "test keywoards ignoring" &&
git-svn commit remotes/git-svn..mybranch && git-svn set-tree remotes/git-svn..mybranch &&
git pull . remotes/git-svn' git pull . remotes/git-svn'
expect='/* $Id$ */' expect='/* $Id$ */'
......
...@@ -21,7 +21,7 @@ test_expect_success 'mirror via git-svn' " ...@@ -21,7 +21,7 @@ test_expect_success 'mirror via git-svn' "
test_expect_success 'Try a commit on rmdir' " test_expect_success 'Try a commit on rmdir' "
git rm -f deeply/nested/directory/number/2/another && git rm -f deeply/nested/directory/number/2/another &&
git commit -a -m 'remove another' && git commit -a -m 'remove another' &&
git-svn commit --rmdir HEAD && git-svn set-tree --rmdir HEAD &&
svn ls -R $svnrepo | grep ^deeply/nested/directory/number/1 svn ls -R $svnrepo | grep ^deeply/nested/directory/number/1
" "
......
...@@ -6,13 +6,6 @@ ...@@ -6,13 +6,6 @@
test_description='git-svn --follow-parent fetching' test_description='git-svn --follow-parent fetching'
. ./lib-git-svn.sh . ./lib-git-svn.sh
if test -n "$GIT_SVN_NO_LIB" && test "$GIT_SVN_NO_LIB" -ne 0
then
echo 'Skipping: --follow-parent needs SVN libraries'
test_done
exit 0
fi
test_expect_success 'initialize repo' " test_expect_success 'initialize repo' "
mkdir import && mkdir import &&
cd import && cd import &&
......
...@@ -4,13 +4,6 @@ ...@@ -4,13 +4,6 @@
test_description='git-svn commit-diff' test_description='git-svn commit-diff'
. ./lib-git-svn.sh . ./lib-git-svn.sh
if test -n "$GIT_SVN_NO_LIB" && test "$GIT_SVN_NO_LIB" -ne 0
then
echo 'Skipping: commit-diff needs SVN libraries'
test_done
exit 0
fi
test_expect_success 'initialize repo' " test_expect_success 'initialize repo' "
mkdir import && mkdir import &&
cd import && cd import &&
......
...@@ -4,13 +4,6 @@ ...@@ -4,13 +4,6 @@
test_description='git-svn commit-diff clobber' test_description='git-svn commit-diff clobber'
. ./lib-git-svn.sh . ./lib-git-svn.sh
if test -n "$GIT_SVN_NO_LIB" && test "$GIT_SVN_NO_LIB" -ne 0
then
echo 'Skipping: commit-diff clobber needs SVN libraries'
test_done
exit 0
fi
test_expect_success 'initialize repo' " test_expect_success 'initialize repo' "
mkdir import && mkdir import &&
cd import && cd import &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册