summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2b27f6c)
raw | patch | inline | side by side (parent: 2b27f6c)
author | Eric Wong <normalperson@yhbt.net> | |
Mon, 29 Jan 2007 05:34:23 +0000 (21:34 -0800) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Fri, 23 Feb 2007 08:57:10 +0000 (00:57 -0800) |
Using path names as refnames breaks horribly if a user is
tracking one large, toplevel directory, and a lower-level
directory is followed from another project is a parent
of another ref, as it will cause refnames such as:
'refs/remotes/trunk/path/to/stuff', which will conflict
with a refname of 'refs/remotes/trunk'.
Now we just append @$revno to the end of it the current
refname. And if we have followed back to a grandparent, then
we'll strip any existing '@$parent_revno' strings before
appending our own '@$revno' string to it.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
tracking one large, toplevel directory, and a lower-level
directory is followed from another project is a parent
of another ref, as it will cause refnames such as:
'refs/remotes/trunk/path/to/stuff', which will conflict
with a refname of 'refs/remotes/trunk'.
Now we just append @$revno to the end of it the current
refname. And if we have followed back to a grandparent, then
we'll strip any existing '@$parent_revno' strings before
appending our own '@$revno' string to it.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl | patch | blob | history | |
t/t9104-git-svn-follow-parent.sh | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index dcc7fd460330330d96f92870d6db8920afa0f27a..4f7938ab7e08f8944aa9782234895e40957c64d2 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
last if $gs;
}
unless ($gs) {
- my $ref_id = $branch_from;
- $ref_id .= "\@$r" if find_ref($ref_id);
+ my $ref_id = $self->{ref_id};
+ $ref_id =~ s/\@\d+$//;
+ $ref_id .= "\@$r";
# just grow a tail if we're not unique enough :x
$ref_id .= '-' while find_ref($ref_id);
+ print STDERR "Initializing parent: $ref_id\n";
$gs = Git::SVN->init($new_url, '', $ref_id, $ref_id);
}
my ($r0, $parent) = $gs->find_rev_before($r, 1);
index 6d243f84887735c0ad82fe3a3134c04950629662..0f4e7362714b548cf67339f2cc4711da4d1c3b6f 100755 (executable)
test_expect_success 'init and fetch --follow-parent a moved directory' "
git-svn init -i thunk $svnrepo/thunk &&
git-svn fetch --follow-parent -i thunk &&
- test \"\`git-rev-parse --verify refs/remotes/trunk\`\" \
+ test \"\`git-rev-parse --verify refs/remotes/thunk@2\`\" \
= \"\`git-rev-parse --verify refs/remotes/thunk~1\`\" &&
test \"\`git-cat-file blob refs/remotes/thunk:readme |\
- sed -n -e '3p'\`\" = goodbye
+ sed -n -e '3p'\`\" = goodbye &&
+ test -n \"\`git-config --get svn-remote.git-svn.fetch \
+ '^trunk:refs/remotes/thunk@2$'\`\"
"
test_expect_success 'init and fetch from one svn-remote' "