[pypy-svn] buildbot default: Fix paths ending in doubleslashes.

trypypy commits-noreply at bitbucket.org
Fri Jan 21 22:32:20 CET 2011


Author: trypypy <victorgarcianet at gmail.com>
Branch: 
Changeset: r443:fd10712c6fd1
Date: 2011-01-21 16:28 -0200
http://bitbucket.org/pypy/buildbot/changeset/fd10712c6fd1/

Log:	Fix paths ending in doubleslashes.

diff --git a/bitbucket_hook/hook.py b/bitbucket_hook/hook.py
--- a/bitbucket_hook/hook.py
+++ b/bitbucket_hook/hook.py
@@ -62,7 +62,7 @@
 
     else:
         common_prefix = os.path.commonprefix(common_prefix)
-        if common_prefix:
+        if common_prefix and not common_prefix.endswith('/'):
             common_prefix += '/'
 
     if listfiles:

diff --git a/bitbucket_hook/test/test_hook.py b/bitbucket_hook/test/test_hook.py
--- a/bitbucket_hook/test/test_hook.py
+++ b/bitbucket_hook/test/test_hook.py
@@ -74,6 +74,9 @@
     nocommonplusslash = distinct + [d(file='path4/dir/')]
     commonplusslash = shared + [d(file='path/dir/')]
 
+    pypydoubleslash = [d(file='pypy/jit/metainterp/opt/u.py'),
+                       d(file='pypy/jit/metainterp/test/test_c.py'),
+                       d(file='pypy/jit/metainterp/test/test_o.py')]
     nothing = ('', '')
     files_expected = [([], nothing),
                       ([empty], nothing),
@@ -91,6 +94,7 @@
                       (commonplusempty, nothing),
                       (nocommonplusslash, nothing),
                       (commonplusslash, ('path/', '')),
+                      (pypydoubleslash, ('pypy/jit/metainterp/', '')),
                       ]
 
     for f, wanted in files_expected:
@@ -113,6 +117,8 @@
                       (commonplusempty, ('',' M(file1, file2, file)')),
                       (nocommonplusslash, ('',' M(file1, file2, file)')),
                       (commonplusslash, ('path/',' M(file1, file2, file)')),
+                      (pypydoubleslash, ('pypy/jit/metainterp/',
+                                         ' M(u.py, test_c.py, test_o.py)')),
                       ]
 
     for f, wanted in files_expected:


More information about the Pypy-commit mailing list