[RFC/PATCH 2/1] fixup! git-svn: use YAML format for mergeinfo cache when possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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';
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]