You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/02/25 04:30:54 UTC

svn commit: r1449582 - in /subversion/trunk/tools/hook-scripts/mailer: mailer.py tests/mailer-init.sh tests/mailer-t1.output

Author: breser
Date: Mon Feb 25 03:30:54 2013
New Revision: 1449582

URL: http://svn.apache.org/r1449582
Log:
Fix problems with the mailer.py test suite and fix mailer.py not showing
directories with property deletions as being modified.

When using svn.repos.replay() property deletions don't show up in the
returned changelist from editor.get_changes().items() since the
changed_dir_prop function on the delta editor never gets called.  This
could be a bug in the Python bindings or our C code.  Setting send_deltas
to true and calling svn.repos.replay2() resolves the problem.

Some of the failures were simply that the group output is in a different
order than it was in the file.  I suspect that the order of output from
mailer.py is not determinate, so long term this test setup will likely
have to be rewritten.

* mailer/mailer.py
  (Commit.__init__): Switch to using svn.repos.replay2() and pass 1 for
    send_deltas.

* mailer/tests/mailer-init.sh
  Use --force when setting the svn:new_svn_prop since we reject properties
  starting with svn: when we don't know about them.  Set the mime-type
  when adding a binary file since we only check for binary files by the
  mime-type.

* mailer/tests/mailer-t1.output
  Reorder some of the output to match the generated output (at least for me)
  

Modified:
    subversion/trunk/tools/hook-scripts/mailer/mailer.py
    subversion/trunk/tools/hook-scripts/mailer/tests/mailer-init.sh
    subversion/trunk/tools/hook-scripts/mailer/tests/mailer-t1.output

Modified: subversion/trunk/tools/hook-scripts/mailer/mailer.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/hook-scripts/mailer/mailer.py?rev=1449582&r1=1449581&r2=1449582&view=diff
==============================================================================
--- subversion/trunk/tools/hook-scripts/mailer/mailer.py (original)
+++ subversion/trunk/tools/hook-scripts/mailer/mailer.py Mon Feb 25 03:30:54 2013
@@ -352,7 +352,7 @@ class Commit(Messenger):
     editor = svn.repos.ChangeCollector(repos.fs_ptr, repos.root_this, \
                                        self.pool)
     e_ptr, e_baton = svn.delta.make_editor(editor, self.pool)
-    svn.repos.replay(repos.root_this, e_ptr, e_baton, self.pool)
+    svn.repos.replay2(repos.root_this, "", svn.core.SVN_INVALID_REVNUM, 1, e_ptr, e_baton, None, self.pool)
 
     self.changelist = sorted(editor.get_changes().items())
 

Modified: subversion/trunk/tools/hook-scripts/mailer/tests/mailer-init.sh
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/hook-scripts/mailer/tests/mailer-init.sh?rev=1449582&r1=1449581&r2=1449582&view=diff
==============================================================================
--- subversion/trunk/tools/hook-scripts/mailer/tests/mailer-init.sh (original)
+++ subversion/trunk/tools/hook-scripts/mailer/tests/mailer-init.sh Mon Feb 25 03:30:54 2013
@@ -52,7 +52,7 @@ svn commit -m "initial load"
 svn ps prop1 propval1 file1
 echo change C1 >> file2
 svn ps svn:keywords Id file2
-svn ps svn:new_svn_prop val file2
+svn ps --force svn:new_svn_prop val file2
 svn ps prop1 propval1 file2
 svn ps prop3 propval3 dir1
 echo change C2 >> dir2/file5
@@ -103,6 +103,7 @@ svn commit -m "copy dir, then make a cha
 # add a binary file and set property to binary value
 echo -e "\x00\x01\x02\x03\x04" > file11
 svn add file11
+svn ps svn:mime-type application/octect-stream file11
 svn ps prop2 -F file11 file9 
 svn commit -m "add binary file"
 

Modified: subversion/trunk/tools/hook-scripts/mailer/tests/mailer-t1.output
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/hook-scripts/mailer/tests/mailer-t1.output?rev=1449582&r1=1449581&r2=1449582&view=diff
==============================================================================
--- subversion/trunk/tools/hook-scripts/mailer/tests/mailer-t1.output (original)
+++ subversion/trunk/tools/hook-scripts/mailer/tests/mailer-t1.output Mon Feb 25 03:30:54 2013
@@ -1,3 +1,30 @@
+Group: file
+Subject: r1 -  dir1 dir2
+
+Author: mailer test
+Date: Sun Sep  9 01:46:40 2001
+New Revision: 1
+
+Log:
+initial load
+
+Added:
+   file1
+   file2
+
+Added: file1
+==============================================================================
+--- /dev/null	00:00:00 1970	(empty, because file is newly added)
++++ file1	Sun Sep  9 01:46:40 2001	(r1)
+@@ -0,0 +1 @@
++file1
+
+Added: file2
+==============================================================================
+--- /dev/null	00:00:00 1970	(empty, because file is newly added)
++++ file2	Sun Sep  9 01:46:40 2001	(r1)
+@@ -0,0 +1 @@
++file2
 Group: file plus other areas
 Subject: r1 -  dir1 dir2
 
@@ -126,32 +153,26 @@ Added: file2
 @@ -0,0 +1 @@
 +file2
 Group: file
-Subject: r1 -  dir1 dir2
+Subject: r2 -  dir1 dir2
 
 Author: mailer test
-Date: Sun Sep  9 01:46:40 2001
-New Revision: 1
+Date: Sun Sep  9 04:33:20 2001
+New Revision: 2
 
 Log:
-initial load
-
-Added:
-   file1
-   file2
+two file changes.  Fixes Blah#123
 
-Added: file1
-==============================================================================
---- /dev/null	00:00:00 1970	(empty, because file is newly added)
-+++ file1	Sun Sep  9 01:46:40 2001	(r1)
-@@ -0,0 +1 @@
-+file1
+Modified:
+   file1   (props changed)
+   file2   (contents, props changed)
 
-Added: file2
+Modified: file2
 ==============================================================================
---- /dev/null	00:00:00 1970	(empty, because file is newly added)
-+++ file2	Sun Sep  9 01:46:40 2001	(r1)
-@@ -0,0 +1 @@
-+file2
+--- file2	Sun Sep  9 01:46:40 2001	(r1)
++++ file2	Sun Sep  9 04:33:20 2001	(r2)
+@@ -1 +1,2 @@
+ file2
++change C1
 Group: bugtracker
 Subject: Fix for Blah#123: r2 -  dir1 dir2
 
@@ -250,27 +271,6 @@ Modified: dir2/file5
 @@ -1 +1,2 @@
  file5
 +change C2
-Group: file
-Subject: r2 -  dir1 dir2
-
-Author: mailer test
-Date: Sun Sep  9 04:33:20 2001
-New Revision: 2
-
-Log:
-two file changes.  Fixes Blah#123
-
-Modified:
-   file1   (props changed)
-   file2   (contents, props changed)
-
-Modified: file2
-==============================================================================
---- file2	Sun Sep  9 01:46:40 2001	(r1)
-+++ file2	Sun Sep  9 04:33:20 2001	(r2)
-@@ -1 +1,2 @@
- file2
-+change C1
 Group: All
 Subject: r3 - dir2 dir3
 
@@ -314,7 +314,7 @@ Copied and modified: dir3/file8 (from r2
 @@ -1 +1,2 @@
  file1
 +change C3
-Group: file plus other areas
+Group: file
 Subject: r5 -  dir1 dir3
 
 Author: mailer test
@@ -326,12 +326,7 @@ changes and deletes of properties
 
 Modified:
    file2   (props changed)
-
-Changes in other areas also in this revision:
-Modified:
-   dir1/   (props changed)
-   dir3/   (props changed)
-Group: All
+Group: file plus other areas
 Subject: r5 -  dir1 dir3
 
 Author: mailer test
@@ -342,10 +337,13 @@ Log:
 changes and deletes of properties
 
 Modified:
+   file2   (props changed)
+
+Changes in other areas also in this revision:
+Modified:
    dir1/   (props changed)
    dir3/   (props changed)
-   file2   (props changed)
-Group: file
+Group: All
 Subject: r5 -  dir1 dir3
 
 Author: mailer test
@@ -356,6 +354,8 @@ Log:
 changes and deletes of properties
 
 Modified:
+   dir1/   (props changed)
+   dir3/   (props changed)
    file2   (props changed)
 Group: file
 Subject: r6 -  dir1 dir4
@@ -411,8 +411,8 @@ Modified: dir1/file3
 @@ -1 +1,2 @@
  file3
 +change C4
-Group: All
-Subject: r6 -  dir1 dir4
+Group: bugtracker
+Subject: Fix for Blaz#456: r6 -  dir1 dir4
 
 Author: mailer test
 Date: Sun Sep  9 15:40:00 2001
@@ -471,8 +471,8 @@ Added: file9
 +++ file9	Sun Sep  9 15:40:00 2001	(r6)
 @@ -0,0 +1 @@
 +file9
-Group: bugtracker
-Subject: Fix for Blaz#456: r6 -  dir1 dir4
+Group: All
+Subject: r6 -  dir1 dir4
 
 Author: mailer test
 Date: Sun Sep  9 15:40:00 2001
@@ -501,6 +501,26 @@ Added: file9
 +++ file9	Sun Sep  9 15:40:00 2001	(r6)
 @@ -0,0 +1 @@
 +file9
+Group: file
+Subject: r7 -  dir1 dir2 dir3 dir3/dir5
+
+Author: mailer test
+Date: Sun Sep  9 18:26:40 2001
+New Revision: 7
+
+Log:
+adds, deletes, and a change
+
+Deleted:
+   file2
+
+Deleted: file2
+==============================================================================
+--- file2	Sun Sep  9 18:26:40 2001	(r6)
++++ /dev/null	00:00:00 1970	(deleted)
+@@ -1,2 +0,0 @@
+-file2
+-change C1
 Group: file plus other areas
 Subject: r7 -  dir1 dir2 dir3 dir3/dir5
 
@@ -588,26 +608,6 @@ Deleted: file2
 @@ -1,2 +0,0 @@
 -file2
 -change C1
-Group: file
-Subject: r7 -  dir1 dir2 dir3 dir3/dir5
-
-Author: mailer test
-Date: Sun Sep  9 18:26:40 2001
-New Revision: 7
-
-Log:
-adds, deletes, and a change
-
-Deleted:
-   file2
-
-Deleted: file2
-==============================================================================
---- file2	Sun Sep  9 18:26:40 2001	(r6)
-+++ /dev/null	00:00:00 1970	(deleted)
-@@ -1,2 +0,0 @@
--file2
--change C1
 Group: All
 Subject: r8 - in dir6: . dir5
 
@@ -644,7 +644,7 @@ Modified: dir6/file4
 @@ -1 +1,2 @@
  file4
 +change C6
-Group: file plus other areas
+Group: file
 Subject: r9 - 
 
 Author: mailer test
@@ -662,7 +662,7 @@ Modified:
 Added: file11
 ==============================================================================
 Binary file. No diff available.
-Group: All
+Group: file plus other areas
 Subject: r9 - 
 
 Author: mailer test
@@ -680,7 +680,7 @@ Modified:
 Added: file11
 ==============================================================================
 Binary file. No diff available.
-Group: file
+Group: All
 Subject: r9 - 
 
 Author: mailer test
@@ -698,7 +698,7 @@ Modified:
 Added: file11
 ==============================================================================
 Binary file. No diff available.
-Group: file plus other areas
+Group: file
 Subject: r10 - 
 
 Author: mailer test
@@ -715,7 +715,7 @@ Modified:
 Modified: file11
 ==============================================================================
 Binary file (source and/or target). No diff available.
-Group: All
+Group: file plus other areas
 Subject: r10 - 
 
 Author: mailer test
@@ -732,7 +732,7 @@ Modified:
 Modified: file11
 ==============================================================================
 Binary file (source and/or target). No diff available.
-Group: file
+Group: All
 Subject: r10 - 
 
 Author: mailer test