You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Shahaf <d....@daniel.shahaf.name> on 2010/11/10 01:05:16 UTC

backporting r964349

hwright@apache.org wrote on Tue, Nov 09, 2010 at 20:09:53 -0000:
> * STATUS: Add note to the r964349 group.

> @@ -350,6 +350,8 @@ Approved changes:
>     Create fails.log files for test runs.
>     Justification:
>       Developer convenience.
> +   Notes:
> +     Somewhat non-trivial merge conflicts.
>     Votes:
>       +1: danielsh, cmpilato, stsp

Sorry about this.  I've put together a backport, but don't have
a 1.6.x build environment for some reason.  Shall I just commit this (it
should work...), or is someone able to test/commit this for me please?

(The backport already has three +1 votes.)

[[[
Index: .
===================================================================
--- .	(revision 1033278)
+++ .	(working copy)

Property changes on: .
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /subversion/trunk:r964349
Index: win-tests.py
===================================================================
--- win-tests.py	(revision 1033278)
+++ win-tests.py	(working copy)
@@ -103,6 +103,7 @@ base_url, fs_type, verbose, cleanup = None, None,
 repo_loc = 'local repository.'
 objdir = 'Debug'
 log = 'tests.log'
+faillog = 'fails.log'
 run_svnserve = None
 svnserve_args = None
 run_httpd = None
@@ -196,13 +197,16 @@ if base_url:
   repo_loc = 'remote repository ' + base_url + '.'
   if base_url[:4] == 'http':
     log = 'dav-tests.log'
+    faillog = 'dav-fails.log'
   elif base_url[:3] == 'svn':
     log = 'svn-tests.log'
+    faillog = 'svn-fails.log'
     run_svnserve = 1
   else:
     # Don't know this scheme, but who're we to judge whether it's
     # correct or not?
     log = 'url-tests.log'
+    faillog = 'url-fails.log'
 
 # Have to move the executables where the tests expect them to be
 copied_execs = []   # Store copied exec files to avoid the final dir scan
@@ -583,6 +587,7 @@ sys.path.insert(0, os.path.join(abs_srcdir, 'build
 import run_tests
 th = run_tests.TestHarness(abs_srcdir, abs_builddir,
                            os.path.join(abs_builddir, log),
+                           os.path.join(abs_builddir, faillog),
                            base_url, fs_type, http_library,
                            server_minor_version, 1, cleanup,
                            enable_sasl, parallel, config_file,
Index: build/run_tests.py
===================================================================
--- build/run_tests.py	(revision 1033278)
+++ build/run_tests.py	(working copy)
@@ -15,7 +15,7 @@ to the TestHarness constructor.  All other paramet
 test programs.
 '''
 
-import os, sys
+import os, re, sys
 import time
 
 import getopt
@@ -28,7 +28,7 @@ class TestHarness:
   '''Test harness for Subversion tests.
   '''
 
-  def __init__(self, abs_srcdir, abs_builddir, logfile,
+  def __init__(self, abs_srcdir, abs_builddir, logfile, faillogfile,
                base_url=None, fs_type=None, http_library=None,
                server_minor_version=None, verbose=None,
                cleanup=None, enable_sasl=None, parallel=None, config_file=None,
@@ -47,6 +47,7 @@ class TestHarness:
     self.srcdir = abs_srcdir
     self.builddir = abs_builddir
     self.logfile = logfile
+    self.faillogfile = faillogfile
     self.base_url = base_url
     self.fs_type = fs_type
     self.http_library = http_library
@@ -106,6 +107,27 @@ class TestHarness:
                                       's'*min(len(failed_list), 1)))
       if xpassed:
         print('  %d test%s XPASSED' % (len(xpassed), 's'*min(len(xpassed), 1)))
+    # Copy the truly interesting verbose logs to a separate file, for easier
+    # viewing.
+    if xpassed or failed_list:
+      faillog = open(self.faillogfile, 'wb')
+      last_start_lineno = None
+      last_start_re = re.compile('^(FAIL|SKIP|XFAIL|PASS|START|CLEANUP|END):')
+      for lineno, line in enumerate(log_lines):
+        # Iterate the lines.  If it ends a test we're interested in, dump that
+        # test to FAILLOG.  If it starts a test (at all), remember the line
+        # number (in case we need it later).
+        if line in xpassed or line in failed_list:
+          faillog.write('[[[\n')
+          faillog.writelines(log_lines[last_start_lineno : lineno+1])
+          faillog.write(']]]\n\n')
+        if last_start_re.match(line):
+          last_start_lineno = lineno + 1
+      faillog.close()
+    elif os.path.exists(self.faillogfile):
+      print("WARNING: no failures, but '%s' exists from a previous run."
+            % self.faillogfile)
+
     self._close_log()
     return failed
 
@@ -281,7 +303,7 @@ def main():
       raise getopt.GetoptError
 
   th = TestHarness(args[0], args[1],
-                   os.path.abspath('tests.log'),
+                   os.path.abspath('tests.log'), os.path.abspath('fails.log'),
                    base_url, fs_type, http_library, server_minor_version,
                    verbose, cleanup, enable_sasl, parallel, config_file,
                    fsfs_sharding, fsfs_packing)
]]]

Thanks,

Daniel

Re: 'svn diff --git' doesn't diff svn:mergeinfo

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Stefan Sperling wrote on Wed, Nov 10, 2010 at 18:48:39 +0100:
> On Wed, Nov 10, 2010 at 03:10:10AM +0200, Daniel Shahaf wrote:
> > % cd src/svn/16x/
> > ### --record-only should suffice
> > % $svn merge -q -c r964349 --accept=postpone ../trunk/
> > % $svn ps -q k v ./
> > % $svn di --git --depth empty
> > Index: .
> > ===================================================================
> > diff --git a/subversion/branches/1.6.x b/subversion/branches/1.6.x
> > --- a/subversion/branches/1.6.x (revision 1033278)
> > +++ b/subversion/branches/1.6.x (working copy)
> > 
> > Property changes on: subversion/branches/1.6.x
> > ___________________________________________________________________
> > Modified: svn:mergeinfo
> >    Merged /subversion/trunk:r964349
> > Added: k
> > ## -0,0 +1 ##
> > +v
> > % 
> > 
> > Shouldn't the propdiff of svn:mergeinfo be presented in the parseable
> > /^##/ form?  (in addition to being displayed in the human-readable form)
> > 
> > The reason for this is so, if someone wants to apply the patch I just
> > posted for me, they don't have to run 'svn merge --record-only' manually,
> > but can have the svn:mergeinfo automagically set by 'svn patch' :-)
> 
> Good idea. Please file an isssue.

Filed <http://subversion.tigris.org/issues/show_bug.cgi?id=3747>.

> This isn't specific to --git. svn patch in general doesn't manually
> diff mergeinfo properties. It just calls the existing mergeinfo diffing
> code, which produces the output you see above.

Re: 'svn diff --git' doesn't diff svn:mergeinfo

Posted by Stefan Sperling <st...@elego.de>.
On Wed, Nov 10, 2010 at 03:10:10AM +0200, Daniel Shahaf wrote:
> % cd src/svn/16x/
> ### --record-only should suffice
> % $svn merge -q -c r964349 --accept=postpone ../trunk/
> % $svn ps -q k v ./
> % $svn di --git --depth empty
> Index: .
> ===================================================================
> diff --git a/subversion/branches/1.6.x b/subversion/branches/1.6.x
> --- a/subversion/branches/1.6.x (revision 1033278)
> +++ b/subversion/branches/1.6.x (working copy)
> 
> Property changes on: subversion/branches/1.6.x
> ___________________________________________________________________
> Modified: svn:mergeinfo
>    Merged /subversion/trunk:r964349
> Added: k
> ## -0,0 +1 ##
> +v
> % 
> 
> Shouldn't the propdiff of svn:mergeinfo be presented in the parseable
> /^##/ form?  (in addition to being displayed in the human-readable form)
> 
> The reason for this is so, if someone wants to apply the patch I just
> posted for me, they don't have to run 'svn merge --record-only' manually,
> but can have the svn:mergeinfo automagically set by 'svn patch' :-)

Good idea. Please file an isssue.
This isn't specific to --git. svn patch in general doesn't manually
diff mergeinfo properties. It just calls the existing mergeinfo diffing
code, which produces the output you see above.

'svn diff --git' doesn't diff svn:mergeinfo

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
% cd src/svn/16x/
### --record-only should suffice
% $svn merge -q -c r964349 --accept=postpone ../trunk/
% $svn ps -q k v ./
% $svn di --git --depth empty
Index: .
===================================================================
diff --git a/subversion/branches/1.6.x b/subversion/branches/1.6.x
--- a/subversion/branches/1.6.x (revision 1033278)
+++ b/subversion/branches/1.6.x (working copy)

Property changes on: subversion/branches/1.6.x
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /subversion/trunk:r964349
Added: k
## -0,0 +1 ##
+v
% 

Shouldn't the propdiff of svn:mergeinfo be presented in the parseable
/^##/ form?  (in addition to being displayed in the human-readable form)

The reason for this is so, if someone wants to apply the patch I just
posted for me, they don't have to run 'svn merge --record-only' manually,
but can have the svn:mergeinfo automagically set by 'svn patch' :-)

Re: backporting r964349

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
If you feel you've resolved the conflicts appropriately, go ahead and commit.

-Hyrum

On Tue, Nov 9, 2010 at 7:05 PM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> hwright@apache.org wrote on Tue, Nov 09, 2010 at 20:09:53 -0000:
>> * STATUS: Add note to the r964349 group.
>
>> @@ -350,6 +350,8 @@ Approved changes:
>>     Create fails.log files for test runs.
>>     Justification:
>>       Developer convenience.
>> +   Notes:
>> +     Somewhat non-trivial merge conflicts.
>>     Votes:
>>       +1: danielsh, cmpilato, stsp
>
> Sorry about this.  I've put together a backport, but don't have
> a 1.6.x build environment for some reason.  Shall I just commit this (it
> should work...), or is someone able to test/commit this for me please?
>
> (The backport already has three +1 votes.)
>
> [[[
> Index: .
> ===================================================================
> --- .   (revision 1033278)
> +++ .   (working copy)
>
> Property changes on: .
> ___________________________________________________________________
> Modified: svn:mergeinfo
>   Merged /subversion/trunk:r964349
> Index: win-tests.py
> ===================================================================
> --- win-tests.py        (revision 1033278)
> +++ win-tests.py        (working copy)
> @@ -103,6 +103,7 @@ base_url, fs_type, verbose, cleanup = None, None,
>  repo_loc = 'local repository.'
>  objdir = 'Debug'
>  log = 'tests.log'
> +faillog = 'fails.log'
>  run_svnserve = None
>  svnserve_args = None
>  run_httpd = None
> @@ -196,13 +197,16 @@ if base_url:
>   repo_loc = 'remote repository ' + base_url + '.'
>   if base_url[:4] == 'http':
>     log = 'dav-tests.log'
> +    faillog = 'dav-fails.log'
>   elif base_url[:3] == 'svn':
>     log = 'svn-tests.log'
> +    faillog = 'svn-fails.log'
>     run_svnserve = 1
>   else:
>     # Don't know this scheme, but who're we to judge whether it's
>     # correct or not?
>     log = 'url-tests.log'
> +    faillog = 'url-fails.log'
>
>  # Have to move the executables where the tests expect them to be
>  copied_execs = []   # Store copied exec files to avoid the final dir scan
> @@ -583,6 +587,7 @@ sys.path.insert(0, os.path.join(abs_srcdir, 'build
>  import run_tests
>  th = run_tests.TestHarness(abs_srcdir, abs_builddir,
>                            os.path.join(abs_builddir, log),
> +                           os.path.join(abs_builddir, faillog),
>                            base_url, fs_type, http_library,
>                            server_minor_version, 1, cleanup,
>                            enable_sasl, parallel, config_file,
> Index: build/run_tests.py
> ===================================================================
> --- build/run_tests.py  (revision 1033278)
> +++ build/run_tests.py  (working copy)
> @@ -15,7 +15,7 @@ to the TestHarness constructor.  All other paramet
>  test programs.
>  '''
>
> -import os, sys
> +import os, re, sys
>  import time
>
>  import getopt
> @@ -28,7 +28,7 @@ class TestHarness:
>   '''Test harness for Subversion tests.
>   '''
>
> -  def __init__(self, abs_srcdir, abs_builddir, logfile,
> +  def __init__(self, abs_srcdir, abs_builddir, logfile, faillogfile,
>                base_url=None, fs_type=None, http_library=None,
>                server_minor_version=None, verbose=None,
>                cleanup=None, enable_sasl=None, parallel=None, config_file=None,
> @@ -47,6 +47,7 @@ class TestHarness:
>     self.srcdir = abs_srcdir
>     self.builddir = abs_builddir
>     self.logfile = logfile
> +    self.faillogfile = faillogfile
>     self.base_url = base_url
>     self.fs_type = fs_type
>     self.http_library = http_library
> @@ -106,6 +107,27 @@ class TestHarness:
>                                       's'*min(len(failed_list), 1)))
>       if xpassed:
>         print('  %d test%s XPASSED' % (len(xpassed), 's'*min(len(xpassed), 1)))
> +    # Copy the truly interesting verbose logs to a separate file, for easier
> +    # viewing.
> +    if xpassed or failed_list:
> +      faillog = open(self.faillogfile, 'wb')
> +      last_start_lineno = None
> +      last_start_re = re.compile('^(FAIL|SKIP|XFAIL|PASS|START|CLEANUP|END):')
> +      for lineno, line in enumerate(log_lines):
> +        # Iterate the lines.  If it ends a test we're interested in, dump that
> +        # test to FAILLOG.  If it starts a test (at all), remember the line
> +        # number (in case we need it later).
> +        if line in xpassed or line in failed_list:
> +          faillog.write('[[[\n')
> +          faillog.writelines(log_lines[last_start_lineno : lineno+1])
> +          faillog.write(']]]\n\n')
> +        if last_start_re.match(line):
> +          last_start_lineno = lineno + 1
> +      faillog.close()
> +    elif os.path.exists(self.faillogfile):
> +      print("WARNING: no failures, but '%s' exists from a previous run."
> +            % self.faillogfile)
> +
>     self._close_log()
>     return failed
>
> @@ -281,7 +303,7 @@ def main():
>       raise getopt.GetoptError
>
>   th = TestHarness(args[0], args[1],
> -                   os.path.abspath('tests.log'),
> +                   os.path.abspath('tests.log'), os.path.abspath('fails.log'),
>                    base_url, fs_type, http_library, server_minor_version,
>                    verbose, cleanup, enable_sasl, parallel, config_file,
>                    fsfs_sharding, fsfs_packing)
> ]]]
>
> Thanks,
>
> Daniel
>