X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=git-archimport.perl;h=23becb7962b3fdf3b31db7b492467fc158015de1;hb=011f4274bbb14e44035586f2ede695d584b8cfd2;hp=3749b8b5728f7bdb0f6adb317b25ecfa81902042;hpb=127bf00f7d2fee044602bec8c76ec9d6bf368025;p=git.git diff --git a/git-archimport.perl b/git-archimport.perl index 3749b8b5..23becb79 100755 --- a/git-archimport.perl +++ b/git-archimport.perl @@ -228,10 +228,12 @@ foreach my $ps (@psets) { # skip commits already in repo # if (ptag($ps->{id})) { - $opt_v && print "Skipping already imported: $ps->{id}\n"; + $opt_v && print " * Skipping already imported: $ps->{id}\n"; next; } + print " * Starting to work on $ps->{id}\n"; + # # create the branch if needed # @@ -408,8 +410,7 @@ foreach my $ps (@psets) { open HEAD, ">$git_dir/refs/heads/$ps->{branch}"; print HEAD $commitid; close HEAD; - unlink ("$git_dir/HEAD"); - symlink("refs/heads/$ps->{branch}","$git_dir/HEAD"); + system('git-update-ref', 'HEAD', "$ps->{branch}"); # tag accordingly ptag($ps->{id}, $commitid); # private tag @@ -563,6 +564,11 @@ sub parselog { next if $t =~ m!\{arch\}/!; next if $t =~ m!\.arch-ids/!; next if $t =~ m!\.arch-inventory$!; + # tla cat-archive-log will give us filenames with spaces as file\(sp)name - why? + # we can assume that any filename with \ indicates some pika escaping that we want to get rid of. + if ($t =~ /\\/ ){ + $t = `tla escape --unescaped '$t'`; + } push (@tmp, shell_quote($t)); } @$ref = @tmp; @@ -675,6 +681,10 @@ sub find_parents { # that branch. # foreach my $branch (keys %branches) { + + # check that we actually know about the branch + next unless -e "$git_dir/refs/heads/$branch"; + my $mergebase = `git-merge-base $branch $ps->{branch}`; die "Cannot find merge base for $branch and $ps->{branch}" if $?; chomp $mergebase;