Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

Re: git svn clone -r HEAD

From: Eric Wong <hidden>
Date: 2016-06-15 22:47:04

Ka-Hing Cheung [off-list ref] wrote:
Hi (not subscribed),

git-svn uses $ra->get_latest_revnum to find out the latest revision, but
that can be problematic, because get_latest_revnum returns the latest
revnum in the entire repository, not restricted by whatever URL you used
to construct $ra. So if you do git svn clone -r HEAD
svn://blah/blah/trunk, it won't work if the latest checkin is in one of
the branches (it will try to fetch a rev that doesn't exist in trunk,
making the clone useless).

This change seems to work, sorry it's not a proper diff:
@sub fetch_all {
-       my $head = $ra->get_latest_revnum;
+       my $head = undef;
+       $ra->get_log("", -1, 0, 1, 0, 1, sub { $head = $_[1] });
Thanks Ka-Hing,

There's an unrelated issue with $ra->get_log being broken with http(s)
URLs that need escaping, so t9118 is failing on me when SVN_HTTPD_PORT
is set (I just found another fix that broke that test, too).  I'll push
out this fix when I can get t9118 fixed with HTTP.

-- 
Eric Wong
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help