aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2006-09-24 22:50:15 -0400
committerJunio C Hamano <junkio@cox.net>2006-09-24 20:19:22 -0700
commitf7bae37f9ab2fdc567780d23495733c9af526e02 (patch)
tree67d5a6111bb3366d956be95f0f608362a55b1e52 /git-svn.perl
parent2f60e4e9c18c4cbe1ceacad1bb975a6206ec0411 (diff)
downloadgit-f7bae37f9ab2fdc567780d23495733c9af526e02.tar.gz
git-f7bae37f9ab2fdc567780d23495733c9af526e02.tar.xz
Allow 'svn fetch' on '(no date)' revisions in Subversion.
Added --ignore-nodate to allow 'git svn fetch' to import revisions from Subversion which have '(no date)' listed as the date of the revision. By default 'git svn fetch' will crash with an error when encountering such a revision. The user may restart the fetch operation by adding --ignore-nodate if they want to continue tracking that repository. I'm not entirely sure why a centralized version control system such as Subversion permits revisions to be created with absolutely no date/time associated with it but it apparently is possible as one of the Subversion repositories that I'm tracking with 'git svn' created such a revision on '(no date)' and by '(no user)'. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 0290850b6..8a2ef9909 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -52,7 +52,7 @@ my ($_revision,$_stdin,$_no_ignore_ext,$_no_stop_copy,$_help,$_rmdir,$_edit,
$_template, $_shared, $_no_default_regex, $_no_graft_copy,
$_limit, $_verbose, $_incremental, $_oneline, $_l_fmt, $_show_commit,
$_version, $_upgrade, $_authors, $_branch_all_refs, @_opt_m,
- $_merge, $_strategy, $_dry_run);
+ $_merge, $_strategy, $_dry_run, $_ignore_nodate);
my (@_branch_from, %tree_map, %users, %rusers, %equiv);
my ($_svn_co_url_revs, $_svn_pg_peg_revs);
my @repo_path_split_cache;
@@ -65,6 +65,7 @@ my %fc_opts = ( 'no-ignore-externals' => \$_no_ignore_ext,
'repack:i' => \$_repack,
'no-metadata' => \$_no_metadata,
'quiet|q' => \$_q,
+ 'ignore-nodate' => \$_ignore_nodate,
'repack-flags|repack-args|repack-opts=s' => \$_repack_flags);
my ($_trunk, $_tags, $_branches);
@@ -1734,6 +1735,8 @@ sub next_log_entry {
my $rev = $1;
my ($author, $date, $lines) = split(/\s*\|\s*/, $_, 3);
($lines) = ($lines =~ /(\d+)/);
+ $date = '1970-01-01 00:00:00 +0000'
+ if ($_ignore_nodate && $date eq '(no date)');
my ($Y,$m,$d,$H,$M,$S,$tz) = ($date =~
/(\d{4})\-(\d\d)\-(\d\d)\s
(\d\d)\:(\d\d)\:(\d\d)\s([\-\+]\d+)/x)