You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Vladimir Prus <gh...@cs.msu.su> on 2003/03/21 13:14:28 UTC

[PATCH] Make svn_load_dirs.pl use --targets

Vladimir Prus wrote:

> The problem is that "..." part in command line is about 230000 characters
> long, and that's too much even for Linux. Is it possible to use "--target"
> command line option to pass the list of targets? I'd be happy to make the
> change myself, but unfortunately cannot read Perl :-(

OK, I've did my best. This allowed me to import the big project which was failing
previously.

Log message:
Make svn_load_dir.pl use --target option, to avoid overrunning command 
line length limitations.

* tools/client-side/svn_load_dirs.pl.in
  (make_targets_list_file): New function.
   Use the above function when adding files/directories.

Patch:
Index: svn_load_dirs.pl.in
===================================================================
--- svn_load_dirs.pl.in	(revision 5418)
+++ svn_load_dirs.pl.in	(working copy)
@@ -14,7 +14,7 @@
 use File::Copy   2.03;
 use File::Find;
 use File::Path   1.0404;
-use File::Temp   0.12   qw(tempdir);
+use File::Temp   0.12   qw(tempdir tempfile);
 use Getopt::Long 2.25;
 use Text::Wrap;
 use URI          1.17;
@@ -413,7 +413,9 @@
         }
       $message = wrap('', '  ', $message);
 
-      read_from_process($svn, 'add', '-N', @dirs_to_create);
+      my $list = make_targets_list_file(@dirs_to_create);      
+      read_from_process($svn, 'add', '-N', '--targets', $list);
+      unlink($list);
       read_from_process($svn, 'commit', @svn_commit_options, '-m', $message);
     }
   else
@@ -1007,7 +1009,9 @@
       {
         my @add_files = sort {length($a) <=> length($b) || $a cmp $b}
                         keys %add_files;
-        read_from_process($svn, 'add', '-N', @add_files);
+        my $list = make_targets_list_file(@add_files);
+        read_from_process($svn, 'add', '-N', '--targets', $list);
+        unlink($list);
 
         # Add properties on the added files.
         foreach my $add_file (@add_files)
@@ -1709,6 +1713,20 @@
   @words;
 }
 
+# Creates a temporary file and stores the argument
+# in it. Returns the file name.
+sub make_targets_list_file
+{
+    my ($fh, $filename) = tempfile("svn_load_dirsXXXXX");
+    foreach my $dir (@_)
+    {
+        print $fh $dir."\n";
+    }
+    close($fh);
+    return $filename;
+}
+
+
 # This package exists just to delete the temporary directory.
 package Temp::Delete;
 



- Volodya

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Make svn_load_dirs.pl use --targets

Posted by Sander Roobol <ph...@wanadoo.nl>.
Filed as issue #1215.

Sander

On Fri, Mar 21, 2003 at 04:14:28PM +0300, Vladimir Prus wrote:
> Vladimir Prus wrote:
> 
> > The problem is that "..." part in command line is about 230000 characters
> > long, and that's too much even for Linux. Is it possible to use "--target"
> > command line option to pass the list of targets? I'd be happy to make the
> > change myself, but unfortunately cannot read Perl :-(
> 
> OK, I've did my best. This allowed me to import the big project which was failing
> previously.
> 
> Log message:
> Make svn_load_dir.pl use --target option, to avoid overrunning command 
> line length limitations.
> 
> * tools/client-side/svn_load_dirs.pl.in
>   (make_targets_list_file): New function.
>    Use the above function when adding files/directories.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org