* [PATCH 0/3] git-svn: several house-keeping fixes
@ 2007-06-13 9:37 Eric Wong
2007-06-13 9:37 ` [PATCH 1/3] git-svn: cleanup: factor out longest_common_path() function Eric Wong
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Eric Wong @ 2007-06-13 9:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
[PATCH 1/3] git-svn: cleanup: factor out longest_common_path() function
- readability
[PATCH 2/3] git-svn: test for creating new directories over svn://
- The bug is already long fixed, but I'd like to add it for
documentation/regression testing purposes in case it breaks again.
[PATCH 3/3] git-svn: reduce stat() calls for a backwards compatibility check
- There's actually a small bugfix in there, too. This should go to maint.
--
Eric Wong
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/3] git-svn: cleanup: factor out longest_common_path() function 2007-06-13 9:37 [PATCH 0/3] git-svn: several house-keeping fixes Eric Wong @ 2007-06-13 9:37 ` Eric Wong 2007-06-13 9:37 ` [PATCH 2/3] git-svn: test for creating new directories over svn:// Eric Wong 2007-06-13 9:37 ` [PATCH 3/3] git-svn: reduce stat() calls for a backwards compatibility check Eric Wong 2 siblings, 0 replies; 4+ messages in thread From: Eric Wong @ 2007-06-13 9:37 UTC (permalink / raw) To: Junio C Hamano; +Cc: git, Eric Wong I hadn't looked at this code in a while and had to read this again to figure out what it did. To avoid having to do this again in the future, I just gave gave the hunk a descriptive name. Signed-off-by: Eric Wong <normalperson@yhbt.net> --- git-svn.perl | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/git-svn.perl b/git-svn.perl index e350061..58f7dd0 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -3072,11 +3072,8 @@ sub gs_do_switch { $editor->{git_commit_ok}; } -sub gs_fetch_loop_common { - my ($self, $base, $head, $gsv, $globs) = @_; - return if ($base > $head); - my $inc = $_log_window_size; - my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc); +sub longest_common_path { + my ($gsv, $globs) = @_; my %common; my $common_max = scalar @$gsv; @@ -3108,6 +3105,15 @@ sub gs_fetch_loop_common { last; } } + $longest_path; +} + +sub gs_fetch_loop_common { + my ($self, $base, $head, $gsv, $globs) = @_; + return if ($base > $head); + my $inc = $_log_window_size; + my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc); + my $longest_path = longest_common_path($gsv, $globs); while (1) { my %revs; my $err; -- 1.5.2.1.243.gbe00 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] git-svn: test for creating new directories over svn:// 2007-06-13 9:37 [PATCH 0/3] git-svn: several house-keeping fixes Eric Wong 2007-06-13 9:37 ` [PATCH 1/3] git-svn: cleanup: factor out longest_common_path() function Eric Wong @ 2007-06-13 9:37 ` Eric Wong 2007-06-13 9:37 ` [PATCH 3/3] git-svn: reduce stat() calls for a backwards compatibility check Eric Wong 2 siblings, 0 replies; 4+ messages in thread From: Eric Wong @ 2007-06-13 9:37 UTC (permalink / raw) To: Junio C Hamano; +Cc: git, Eric Wong As reported by Matthieu Moy, this is causing svnserve to terminate connections (because it segfaults) segfault. This test is disabled by default and can be enabled by setting SVNSERVE_PORT to an unbound (for 127.0.0.1) TCP port in the environment (in addition to SVN_TESTS=1). I'm not comfortable with having a test start a daemon by default and take up a port that could potentially stay running if the test failed. Signed-off-by: Eric Wong <normalperson@yhbt.net> --- t/t9113-git-svn-dcommit-new-file.sh | 40 +++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) create mode 100755 t/t9113-git-svn-dcommit-new-file.sh diff --git a/t/t9113-git-svn-dcommit-new-file.sh b/t/t9113-git-svn-dcommit-new-file.sh new file mode 100755 index 0000000..9ef0db9 --- /dev/null +++ b/t/t9113-git-svn-dcommit-new-file.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# +# Copyright (c) 2007 Eric Wong +# + +# Don't run this test by default unless the user really wants it +# I don't like the idea of taking a port and possibly leaving a +# daemon running on a users system if the test fails. +# Not all git users will need to interact with SVN. +test -z "$SVNSERVE_PORT" && exit 0 + +test_description='git-svn dcommit new files over svn:// test' + +. ./lib-git-svn.sh + +start_svnserve () { + svnserve --listen-port $SVNSERVE_PORT \ + --root $rawsvnrepo \ + --listen-once \ + --listen-host 127.0.0.1 & +} + +test_expect_success 'start tracking an empty repo' " + svn mkdir -m 'empty dir' $svnrepo/empty-dir && + echo anon-access = write >> $rawsvnrepo/conf/svnserve.conf && + start_svnserve && + git svn init svn://127.0.0.1:$SVNSERVE_PORT && + git svn fetch + " + +test_expect_success 'create files in new directory with dcommit' " + mkdir git-new-dir && + echo hello > git-new-dir/world && + git update-index --add git-new-dir/world && + git commit -m hello && + start_svnserve && + git svn dcommit + " + +test_done -- 1.5.2.1.243.gbe00 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] git-svn: reduce stat() calls for a backwards compatibility check 2007-06-13 9:37 [PATCH 0/3] git-svn: several house-keeping fixes Eric Wong 2007-06-13 9:37 ` [PATCH 1/3] git-svn: cleanup: factor out longest_common_path() function Eric Wong 2007-06-13 9:37 ` [PATCH 2/3] git-svn: test for creating new directories over svn:// Eric Wong @ 2007-06-13 9:37 ` Eric Wong 2 siblings, 0 replies; 4+ messages in thread From: Eric Wong @ 2007-06-13 9:37 UTC (permalink / raw) To: Junio C Hamano; +Cc: git, Eric Wong Also, this fixes a bug where in an odd case a remote named "config" could get renamed to ".metadata". Signed-off-by: Eric Wong <normalperson@yhbt.net> --- git-svn.perl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/git-svn.perl b/git-svn.perl index 58f7dd0..0ae8d70 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -1457,7 +1457,7 @@ sub tmp_config { my (@args) = @_; my $old_def_config = "$ENV{GIT_DIR}/svn/config"; my $config = "$ENV{GIT_DIR}/svn/.metadata"; - if (-e $old_def_config && ! -e $config) { + if (! -f $config && -f $old_def_config) { rename $old_def_config, $config or die "Failed rename $old_def_config => $config: $!\n"; } -- 1.5.2.1.243.gbe00 ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-06-13 9:37 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-06-13 9:37 [PATCH 0/3] git-svn: several house-keeping fixes Eric Wong 2007-06-13 9:37 ` [PATCH 1/3] git-svn: cleanup: factor out longest_common_path() function Eric Wong 2007-06-13 9:37 ` [PATCH 2/3] git-svn: test for creating new directories over svn:// Eric Wong 2007-06-13 9:37 ` [PATCH 3/3] git-svn: reduce stat() calls for a backwards compatibility check Eric Wong
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox