tag 363003 +patch
tag 422342 +patch
thanks

Just for the record, a new patch is attached.

Hauke
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 11968)
+++ debian/changelog	(working copy)
@@ -30,8 +30,10 @@
   * improved copyright file
 
   [ Jan Hauke Rahm ]
-  * SDCommon.pm: Trigger a warning when files are ignored by subversion
-    (Closes: #504233)
+  * When files are ignored due to subversion ignore patterns the user gets
+    prompted to skip or import those files; in noninteractive mode those files
+    are automatically skiped unless '--ignored-files-action=import' (only in
+    svn-upgrade) is set. (Closes: #504233)
   * Dropping support for linda (Closes: #502653)
 
   [ Eddy Petrișor ]
Index: doc/svn-upgrade.sgml
===================================================================
--- doc/svn-upgrade.sgml	(revision 11968)
+++ doc/svn-upgrade.sgml	(working copy)
@@ -173,7 +173,18 @@
         </glossdef>
       </glossentry>
 
-    <para>
+       <glossentry>
+        <glossterm>
+          <cmdsynopsis><group>
+            <arg><option>--ignored-files-action STRING</option></arg>
+          </group></cmdsynopsis>
+        </glossterm>
+        <glossdef>
+          <para>Make files that are ignored due to subversion ignore patterns to be 'import'ed or 'skip'ed.</para>
+        </glossdef>
+      </glossentry>
+
+   <para>
     Tarballs must be compressed with gzip or bzip2.
     </para>
 
Index: SDCommon.pm
===================================================================
--- SDCommon.pm	(revision 11968)
+++ SDCommon.pm	(working copy)
@@ -579,17 +579,28 @@
     for(keys %tmp) {
         if($tmp{$_} == 2) {
             $ctx->add($_, 1);
-        } elsif($tmp{$_} == 11) {   # subversion ignores some files, like .swp from vim; see #504233 for details
-            print STDERR "One or more files are ignore due to global subversion ignore patterns,\n\tquit the process here? [y/n?]: ";
-            prompt:
-            my $ans = <STDIN>;
-            if($ans !~ /^[yn]/i) {
-                print STDERR "The choices are:\n\tYes (y) which means aborting, or No (n) which means to NOT include those files.\n";
-                goto prompt;
-            }
-            if($ans =~ /^y$/i) {
-                exwerror("Aborting.\n");
-            }
+        } elsif($tmp{$_} == 11) {
+           if ($SDCommon::opt_ignored_files_action) {
+              exwerror "Action for ignored files must be either 'import' or 'skip'!\nAborting!"
+                unless ($SDCommon::opt_ignored_files_action eq "import" or $SDCommon::opt_ignored_files_action eq "skip");
+              $ctx->add($_, 1) if $SDCommon::opt_ignored_files_action eq "import";
+           } else {
+              unless ($SDCommon::opt_noninteractive) {
+                 print STDERR "One or more files are ignore due to (global) subversion ignore patterns,\n\thow to procede (quit, import, skip)? [Qis?]: ";
+                 prompt:
+                 my $ans = <STDIN>;
+                 exwerror "Aborting!\n" if ($ans =~ /^$/ or $ans =~ /^q/i);
+                 if ($ans =~ /^i/i) {
+                    $ctx->add($_, 1);
+                    $SDCommon::opt_ignored_files_action = "import";
+                 } elsif ($ans =~ /^s/i) {
+                    $SDCommon::opt_ignored_files_action = "skip";
+                 } else {
+                    print STDERR "Your choices are:\n\tQuit (q), import (i) which means to add ignored files or skip (s)\n\twhich means to NOT include those files.\n";
+                    goto prompt;
+                 }
+              }
+           }
         }
     }
     chdir $curdir;
Index: svn-upgrade
===================================================================
--- svn-upgrade	(revision 11968)
+++ svn-upgrade	(working copy)
@@ -26,6 +26,8 @@
   -r, --replay-conflicting         Special cleanup action: replaces all
                                    conflicting files with upstream versions
   -N, --noautodch                  Upgrade without making a new changelog entry
+  --ignored-files-action STRING    Make files that are ignored due to subversion
+                                   ignore patterns to be either 'import'ed or 'skip'ed
 
 The new source may be a tarball compressed with gzip or bzip2 or a
 directory with extraced source.
@@ -49,6 +51,7 @@
 my $opt_noautodch;
 my $opt_noninteractive;
 my $opt_ignoreerrors;
+my $opt_ignored_files_action;
 
 my %options = (
    "h|help"                => \$opt_help,
@@ -61,6 +64,7 @@
    "N|noautodch"           => \$opt_noautodch,
    "noninteractive"        => \$opt_noninteractive,
    "ignoreerrors"          => \$opt_ignoreerrors,
+   "ignored-files-action=s"=> \$opt_ignored_files_action,
 );
 
 my $retval = 0;
@@ -75,7 +79,7 @@
             next SKIP if /^#/;
             # drop leading spaces
             s/^\s+//;
-            if(/^svn-(noautodch|noninteractive|ignoreerrors|verbose|force|clean|replay-conflicting)/) {
+            if(/^svn-(noautodch|noninteractive|ignoreerrors|verbose|force|clean|replay-conflicting|ignored-files-action)/) {
                 # remove spaces between
                 s/^(\S+)\s*=\s*/$1=/;
                 #remove leading svn, since update does not have that
@@ -96,7 +100,6 @@
 }
 
 
-
 &help unless ( GetOptions(%options));
 &help if ($opt_help);
 
@@ -151,6 +154,10 @@
 use SDCommon;
 $ENV{"SVN_BUILDPACKAGE"} = $SDCommon::version;
 
+SDCommon::exwerror "Action for ignored files must be either 'import' or 'skip'!\nAborting!"
+    if ($opt_ignored_files_action and !($opt_ignored_files_action eq "import" or $opt_ignored_files_action eq "skip"));
+$SDCommon::opt_ignored_files_action = $opt_ignored_files_action;
+
 $SDCommon::opt_verbose=$verbose;
 SDCommon::configure;
 #$tagVersion=$SDCommon::tagVersion;

Attachment: signature.asc
Description: Digital signature

Reply via email to