svn commit: samba-web r212 - hooks

metze at samba.org metze at samba.org
Wed Aug 4 13:20:41 GMT 2004


Author: metze
Date: 2004-08-04 13:20:40 +0000 (Wed, 04 Aug 2004)
New Revision: 212
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba-web&path=/&rev=212&nolog=1
Log:
merge 100line diff

metze

Modified:
   hooks/commit-email.pl

Changeset:
Modified: hooks/commit-email.pl
===================================================================
--- hooks/commit-email.pl	2004-08-03 14:45:49 UTC (rev 211)
+++ hooks/commit-email.pl	2004-08-04 13:20:40 UTC (rev 212)
@@ -52,6 +52,10 @@
 # $no_diff_deleted to 1.
 my $no_diff_deleted = 0;
 
+# Maximum number of lines to display in a diff.  If there are more
+# than this many lines, don't include a diff at all.
+my $max_difflines = 100;
+
 # Since the path to svnlook depends upon the local installation
 # preferences, check that the required programs exist to insure that
 # the administrator has set up the script properly.
@@ -277,6 +281,8 @@
 
 # Get the diff from svnlook.
 my @no_diff_deleted = $no_diff_deleted ? ('--no-diff-deleted') : ();
+my @difflines = &read_from_process($svnlook, 'diff', $repos,
+                                   '-r', $rev, @no_diff_deleted);
 
 ######################################################################
 # Modified directory name collapsing.
@@ -335,7 +341,9 @@
 push(@body, "Author: $author\n");
 push(@body, "Date: $date\n");
 push(@body, "New Revision: $rev\n");
-push(@body, "\n");
+push(@body, "WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba-web\&path=/$commondir\&rev=$rev\&nolog=1\n");
+push(@body, "Log:\n");
+push(@body, @log);
 if (@adds)
   {
     @adds = sort @adds;
@@ -354,12 +362,13 @@
     push(@body, "Modified:\n");
     push(@body, map { "   $_\n" } @mods);
   }
-push(@body, "Log:\n");
-push(@body, @log);
-push(@body, "\n");
-
-push(@body, "WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba-web\&path=/$commondir\&rev=$rev\&nolog=1\n");
-
+push(@body, "\nChangeset:\n");
+if ($#difflines <= $max_difflines) {
+    push(@body, map { /[\r\n]+$/ ? $_ : "$_\n" } @difflines);
+} else {
+    push(@body, "Sorry the patch is to large, please use WebSVN to see it!\n");
+};
+       
 # Go through each project and see if there are any matches for this
 # project.  If so, send the log out.
 foreach my $project (@project_settings_list)



More information about the samba-cvs mailing list