From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Eric Wong <normalperson@yhbt.net>, Jason Gross <jgross@MIT.EDU>,
git@vger.kernel.org
Subject: [RFC/PATCH 2/1] fixup! git-svn: use YAML format for mergeinfo cache when possible
Date: Sun, 27 May 2012 14:48:22 -0500 [thread overview]
Message-ID: <20120527194822.GA31460@burratino> (raw)
In-Reply-To: <20120527192541.GA29490@burratino>
Jonathan Nieder wrote:
> YAML::Any is not a core perl module. This patch uses it when and only
> when it is available.
And here's a patch for squashing in that makes that true. Sorry for
the confusion.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
git-svn.perl | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git c/git-svn.perl i/git-svn.perl
index 96b6046a..1b4ef68f 100755
--- c/git-svn.perl
+++ i/git-svn.perl
@@ -2042,7 +2042,11 @@ sub gc_directory {
package Git::SVN::Memoize::YAML;
use warnings;
use strict;
-use YAML::Any ();
+my $usable;
+BEGIN {
+ $Git::SVN::Memoize::YAML::usable = eval { require YAML::Any; 1 };
+ require YAML::Any if $usable;
+}
# based on Memoize::Storable.
@@ -2151,10 +2155,6 @@ use Time::Local;
use Memoize; # core since 5.8.0, Jul 2002
use Memoize::Storable;
use POSIX qw(:signal_h);
-my $can_use_yaml;
-BEGIN {
- $can_use_yaml = eval { require YAML::Any; 1};
-}
my ($_gc_nr, $_gc_period);
@@ -3681,7 +3681,7 @@ sub tie_for_persistent_memoization {
my $hash = shift;
my $path = shift;
- if ($can_use_yaml) {
+ if ($Git::SVN::Memoize::YAML::usable) {
tie %$hash => 'Git::SVN::Memoize::YAML', "$path.yaml";
} else {
tie %$hash => 'Memoize::Storable', "$path.db", 'nstore';
next prev parent reply other threads:[~2012-05-27 19:48 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 2:17 [PATCH] git-svn: Destroy the cache when we fail to read it Jason Gross
2011-08-22 4:04 ` Jason Gross
2011-08-22 4:10 ` [PATCH] Add tests for handling corrupted caches Jason Gross
2011-08-23 2:27 ` [PATCH] git-svn: Destroy the cache when we fail to read it Jonathan Nieder
2011-08-23 2:36 ` Jonathan Nieder
2011-08-23 5:51 ` Jason Gross
2011-08-23 8:15 ` Eric Wong
2011-08-23 17:05 ` Junio C Hamano
2011-08-23 19:58 ` Eric Wong
2012-05-27 19:25 ` [RFC/PATCH] git-svn: use YAML format for mergeinfo cache when possible Jonathan Nieder
2012-05-27 19:48 ` Jonathan Nieder [this message]
2012-05-27 20:14 ` Eric Wong
2012-05-28 0:39 ` Jonathan Nieder
2012-05-28 6:57 ` [RFC/PATCH 0/2] git-svn: give SVN::Git::Fetcher its own file Jonathan Nieder
2012-05-28 7:00 ` [PATCH 1/2] git-svn: rename SVN::Git::* packages to Git::SVN::* Jonathan Nieder
2012-05-28 7:03 ` [PATCH 2/2] git-svn: make Git::SVN::Fetcher a separate file Jonathan Nieder
2012-05-29 0:25 ` [RFC/PATCH] git-svn: use YAML format for mergeinfo cache when possible Eric Wong
2012-05-29 20:48 ` Junio C Hamano
2012-06-09 22:20 ` [PATCH v2 0/3] " Jonathan Nieder
2012-06-09 22:25 ` [PATCH 1/3] git-svn: make Git::SVN::Editor a separate file Jonathan Nieder
2012-06-09 22:28 ` [PATCH 2/3] git-svn: make Git::SVN::RA " Jonathan Nieder
2012-06-09 22:35 ` [PATCH 3/3] git-svn: use YAML format for mergeinfo cache when possible Jonathan Nieder
2012-06-13 1:34 ` Jonathan Nieder
2012-06-10 9:00 ` [PATCH v2 0/3] " Eric Wong
2012-06-10 10:04 ` Jonathan Nieder
2012-06-11 15:06 ` Junio C Hamano
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=20120527194822.GA31460@burratino \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jgross@MIT.EDU \
--cc=normalperson@yhbt.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.