git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/5] git-svn: memoize conversion of SVN merge ticket info to git commit ranges

From
EWEric Wong <normalperson@yhbt.net>
Date
Dec 21, 2009, 10:44 UTC
Message-ID
<20091221104443.GA14539@dcvr.yhbt.net>
In-Reply-To
<1261344246.20752.24.camel@denix>
Sam Vilain <sam@vilain.net> wrote:
Show 16 quoted lines
> On Sun, 2009-12-20 at 05:33 +1300, Sam Vilain wrote:
> > +sub lookup_svn_merge {
> > +	my $uuid = shift;
> > +	my $url = shift;
> > +	my $merge = shift;
> > +
> > +	my ($source, $revs) = split ":", $merge;
> > +	my $path = $source;
> > +	$path =~ s{^/}{};
> > +	my $gs = Git::SVN->find_by_url($url.$source, $url, $path);
> > +	if ( !$gs ) {
> > +		warn "Couldn't find revmap for $url$source\n";
> > +		next;
> > +	}
> 
> As mentioned in the other thread, that 'next' should now be 'return'.

Thanks Sam and Andrew. I've acked this series and pushed them out along with a release notes update as well as another small fix (inline below).

Eric Wong (2):
      git svn: fix --revision when fetching deleted paths
      update release notes for git svn in 1.6.6
Sam Vilain (5):
      git-svn: expand the svn mergeinfo test suite, highlighting some failures
      git-svn: memoize conversion of SVN merge ticket info to git commit ranges
      git-svn: fix some mistakes with interpreting SVN mergeinfo commit ranges
      git-svn: exclude already merged tips using one rev-list call
      git-svn: detect cherry-picks correctly.
>From 577e9fcad2c8968846b365226b89778050496a78 Mon Sep 17 00:00:00 2001
From: Eric Wong <normalperson@yhbt.net>
Date: Mon, 21 Dec 2009 02:06:04 -0800
Subject: [PATCH] git svn: fix --revision when fetching deleted paths

When using the -r/--revision argument to fetch deleted history, calling SVN::Ra::get_log() from an SVN::Ra object initialized to track the deleted URL will fail.

This regression was introduced in:
  commit 4aacaeb3dc82bb6479e70e120053dc27a399460e
  "fix shallow clone when upstream revision is too new"

We now ignore errors from SVN::Ra::get_log() here because using --revision will always override the value of $head here if (and only if) we're tracking deleted directories.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-svn.perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index d362de7..a6f5061 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1741,7 +1741,11 @@ sub fetch_all {
 	my $ra = Git::SVN::Ra->new($url);
 	my $uuid = $ra->get_uuid;
 	my $head = $ra->get_latest_revnum;
-	$ra->get_log("", $head, 0, 1, 0, 1, sub { $head = $_[1] });
+
+	# ignore errors, $head revision may not even exist anymore
+	eval { $ra->get_log("", $head, 0, 1, 0, 1, sub { $head = $_[1] }) };
+	warn "W: $@\n" if $@;
+
 	my $base = defined $fetch ? $head : 0;
 
 	# read the max revs for wildcard expansion (branches/*, tags/*)
-- 
Eric Wong
Previous: Sam VilainNext: Sam Vilain
Message 9 of 13 in “Efficiency and correctness patches for git-svn mergeinfo support”
  1. Sam VilainDec 19, 2009
  2. 1/5 git-svn: expand the svn mergeinfo test suite, highlighting some failuresSam Vilain, Dec 19, 2009
  3. 2/5 git-svn: memoize conversion of SVN merge ticket info to git commit rangesSam Vilain, Dec 19, 2009
  4. 3/5 git-svn: fix some mistakes with interpreting SVN mergeinfo commit rangesSam Vilain, Dec 19, 2009
  5. 4/5 git-svn: exclude already merged tips using one rev-list callSam Vilain, Dec 19, 2009
  6. 5/5 git-svn: detect cherry-picks correctly.Sam Vilain, Dec 19, 2009
  7. Sam VilainDec 19, 2009
  8. Sam VilainDec 20, 2009
  9. Eric WongDec 21, 2009
  10. Sam VilainDec 19, 2009
  11. Andrew MyrickDec 19, 2009
  12. Sam VilainDec 20, 2009
  13. Andrew MyrickDec 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.