From: Manu <manu@blairos.org>
To: Eduardo Pereira Habkost <ehabkost@mandriva.com>
Cc: git@vger.kernel.org
Subject: Re: git-svnimport issue with rename+change in the same commit
Date: Tue, 14 Feb 2006 18:29:23 +0100 [thread overview]
Message-ID: <43F21373.8040400@blairos.org> (raw)
In-Reply-To: <20060214171233.GC4381@duckman.conectiva>
Hi,
Eduardo Pereira Habkost wrote:
> Hi,
>
> I've just hit a problem when using git-svnimport to import a big
> subversion repository: it doesn't import correctly a commit when the
> commit renames (or copies) and modify a file at the same time.
I came accross the same problem myself. Here is a patch that seemed to
do the trick for me.
I tried your script, and it also seems to work.
Regards,
Emmanuel
---
[PATCH] git-svnimport: Correction when a "copy_path" has different
contents for src and dest.
In my SVN repository, there is a weird log:
A /trunk/mydir2 (from /trunk/mydir1:4)
R /trunk/mydir2/test.txt (from /trunk/mydir1/test.txt:4)
As a result, mydir2/test.txt is different than mydir1/test.txt, but
git-svnimport assumes that the content of mydir2/test.txt is the same
as mydir1/test.txt.
This patch adds a test in copy_path, that makes sure that src and dest
have the same content. If not, it uses the content of dest.
---
git-svnimport.perl | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
e107ff9a06497a0003036ffafa45fa9dc050ecc4
diff --git a/git-svnimport.perl b/git-svnimport.perl
index f17d5a2..a2faa9a 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -409,6 +409,12 @@ sub copy_path($$$$$$$$) {
$p = $path . substr($p,length($srcpath)-1);
} else {
$p = $path;
+ # Deal with copy and modification
+ my $f=get_file($newrev,$newbranch,$path);
+ my ($tmode,$tsha1,$tp)=@$f;
+ if ($tsha1 ne $sha1) {
+ $sha1=$tsha1;
+ }
}
push(@$new,[$mode,$sha1,$p]);
}
--
1.1.GIT
prev parent reply other threads:[~2006-02-14 17:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-14 17:12 git-svnimport issue with rename+change in the same commit Eduardo Pereira Habkost
2006-02-14 17:29 ` Manu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43F21373.8040400@blairos.org \
--to=manu@blairos.org \
--cc=ehabkost@mandriva.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).