[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

ddkilzer at apple.com ddkilzer at apple.com
Thu Oct 29 20:34:45 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 33e4fbc9aabb9975ec114a19bef7fcf4acb64c13
Author: ddkilzer at apple.com <ddkilzer at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Sep 26 22:57:25 2009 +0000

            svn-unapply and svn-apply don't work when used outside multiple svn working directories
    
            <http://webkit.org/b/29744>
            <rdar://problem/7252905>
    
            Reviewed by Eric Seidel.
    
            Some users have a workflow where svn-create-patch, svn-apply and
            svn-unapply are used outside of multiple svn working
            directories.  Instead of aborting the scripts in these cases,
            print a warning and assume that Subversion is being used.
    
            * Scripts/VCSUtils.pm:
            (determineVCSRoot): Call warn() instead of die() if both isGit()
            and isSVN() initially return false.  Set $VCSUtils::isSVN to 1
            to enforce the assumption about Subversion, then return
            determineSVNRoot().
            * Scripts/svn-apply: Switch to using isGit() and isSVN() from
            VCSUtils.pm.  They both already cache their values and checking
            here is redundant since determineVCSRoot() is called later.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48793 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index f998226..61e5b0a 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,26 @@
+2009-09-26  David Kilzer  <ddkilzer at apple.com>
+
+        svn-unapply and svn-apply don't work when used outside multiple svn working directories
+
+        <http://webkit.org/b/29744>
+        <rdar://problem/7252905>
+
+        Reviewed by Eric Seidel.
+
+        Some users have a workflow where svn-create-patch, svn-apply and
+        svn-unapply are used outside of multiple svn working
+        directories.  Instead of aborting the scripts in these cases,
+        print a warning and assume that Subversion is being used.
+
+        * Scripts/VCSUtils.pm:
+        (determineVCSRoot): Call warn() instead of die() if both isGit()
+        and isSVN() initially return false.  Set $VCSUtils::isSVN to 1
+        to enforce the assumption about Subversion, then return
+        determineSVNRoot().
+        * Scripts/svn-apply: Switch to using isGit() and isSVN() from
+        VCSUtils.pm.  They both already cache their values and checking
+        here is redundant since determineVCSRoot() is called later.
+
 2009-09-26  Zan Dobersek  <zandobersek at gmail.com>
 
         Reviewed by Gustavo Noronha.
diff --git a/WebKitTools/Scripts/VCSUtils.pm b/WebKitTools/Scripts/VCSUtils.pm
index 49f2f54..6ec12c9 100644
--- a/WebKitTools/Scripts/VCSUtils.pm
+++ b/WebKitTools/Scripts/VCSUtils.pm
@@ -207,10 +207,16 @@ sub determineVCSRoot()
     if (isGit()) {
         return determineGitRoot();
     }
-    if (isSVN()) {
-        return determineSVNRoot();
+
+    if (!isSVN()) {
+        # Some users have a workflow where svn-create-patch, svn-apply and
+        # svn-unapply are used outside of multiple svn working directores,
+        # so warn the user and assume Subversion is being used in this case.
+        warn "Unable to determine VCS root; assuming Subversion";
+        $isSVN = 1;
     }
-    die "Unable to determine VCS root";
+
+    return determineSVNRoot();
 }
 
 sub svnRevisionForDirectory($)
diff --git a/WebKitTools/Scripts/svn-apply b/WebKitTools/Scripts/svn-apply
index 17a6ab4..19c8c56 100755
--- a/WebKitTools/Scripts/svn-apply
+++ b/WebKitTools/Scripts/svn-apply
@@ -111,10 +111,6 @@ if (!$optionParseSuccess || $showHelp) {
     exit 1;
 }
 
-my $isGit = isGitDirectory(".");
-my $isSVN = isSVNDirectory(".");
-$isSVN || $isGit || die "Couldn't determine your version control system.";
-
 my %removeDirectoryIgnoreList = (
     '.' => 1,
     '..' => 1,
@@ -179,7 +175,7 @@ if ($patch && !$copiedFromPath) {
 }
 
 if ($merge) {
-    die "--merge is currently only supported for SVN" unless $isSVN;
+    die "--merge is currently only supported for SVN" unless isSVN();
     # How do we handle Git patches applied to an SVN checkout here?
     for my $file (sort keys %versions) {
         print "Getting version $versions{$file} of $file\n";
@@ -417,7 +413,7 @@ sub patch($)
             unlink("$fullPath.orig") if -e "$fullPath.orig" && checksum($fullPath) eq checksum("$fullPath.orig");
             scmAdd($fullPath);
             # What is this for?
-            system "svn", "stat", "$fullPath.orig" if $isSVN && -e "$fullPath.orig";
+            system "svn", "stat", "$fullPath.orig" if isSVN() && -e "$fullPath.orig";
         }
     }
 }
@@ -496,10 +492,10 @@ sub svnStatus($)
 sub scmWillDeleteFile($)
 {
     my ($path) = @_;
-    if ($isSVN) {
+    if (isSVN()) {
         my $svnOutput = svnStatus($path);
         return 1 if $svnOutput && substr($svnOutput, 0, 1) eq "D";
-    } elsif ($isGit) {
+    } elsif (isGit()) {
         my $gitOutput = `git diff-index --name-status HEAD -- $path`;
         return 1 if $gitOutput && substr($gitOutput, 0, 1) eq "D";
     }
@@ -509,7 +505,7 @@ sub scmWillDeleteFile($)
 sub scmKnowsOfFile($)
 {
     my ($path) = @_;
-    if ($isSVN) {
+    if (isSVN()) {
         my $svnOutput = svnStatus($path);
         # This will match more than intended.  ? might not be the first field in the status
         if ($svnOutput && $svnOutput =~ m#\?\s+$path\n#) {
@@ -517,7 +513,7 @@ sub scmKnowsOfFile($)
         }
         # This does not handle errors well.
         return 1;
-    } elsif ($isGit) {
+    } elsif (isGit()) {
         `git ls-files --error-unmatch -- $path`;
         my $exitCode = $? >> 8;
         return $exitCode == 0;
@@ -527,9 +523,9 @@ sub scmKnowsOfFile($)
 sub scmCopy($$)
 {
     my ($source, $destination) = @_;
-    if ($isSVN) {
+    if (isSVN()) {
         system "svn", "copy", $source, $destination;
-    } elsif ($isGit) {
+    } elsif (isGit()) {
         system "cp", $source, $destination;
         system "git", "add", $destination;
     }
@@ -538,9 +534,9 @@ sub scmCopy($$)
 sub scmAdd($)
 {
     my ($path) = @_;
-    if ($isSVN) {
+    if (isSVN()) {
         system "svn", "add", $path;
-    } elsif ($isGit) {
+    } elsif (isGit()) {
         system "git", "add", $path;
     }
 }
@@ -548,7 +544,7 @@ sub scmAdd($)
 sub scmRemove($)
 {
     my ($path) = @_;
-    if ($isSVN) {
+    if (isSVN()) {
         # SVN is very verbose when removing directories.  Squelch all output except the last line.
         my $svnOutput;
         open SVN, "svn rm --force '$path' |" or die "svn rm --force '$path' failed!";
@@ -558,7 +554,7 @@ sub scmRemove($)
         }
         close SVN;
         print $svnOutput if $svnOutput;
-    } elsif ($isGit) {
+    } elsif (isGit()) {
         system "git", "rm", "--force", $path;
     }
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list