[ARVADOS] updated: d0bb2d7e6ee928e3620297a9239f26d7e6115be3

git at public.curoverse.com git at public.curoverse.com
Fri Oct 31 19:40:54 EDT 2014


Summary of changes:
 sdk/python/arvados/collection.py     |  4 ++--
 sdk/python/tests/test_collections.py | 19 +++++++++++--------
 2 files changed, 13 insertions(+), 10 deletions(-)

  discards  e753cd61976a6971bd71cb26279d15487c6da391 (commit)
       via  d0bb2d7e6ee928e3620297a9239f26d7e6115be3 (commit)
       via  55a0e060233385a9be029d0e75c152307950e268 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (e753cd61976a6971bd71cb26279d15487c6da391)
            \
             N -- N -- N (d0bb2d7e6ee928e3620297a9239f26d7e6115be3)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit d0bb2d7e6ee928e3620297a9239f26d7e6115be3
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Oct 31 19:39:59 2014 -0400

    3706: Clarify test case.

diff --git a/sdk/python/tests/test_collections.py b/sdk/python/tests/test_collections.py
index df8ba38..e31b1d4 100644
--- a/sdk/python/tests/test_collections.py
+++ b/sdk/python/tests/test_collections.py
@@ -770,19 +770,22 @@ class CollectionReaderTestCase(unittest.TestCase, CollectionTestMixin):
         # client should be able to use CollectionReader on a manifest without normalizing it
         client = self.api_client_mock(500)
         nonnormal = ". acbd18db4cc2f85cedef654fccc4a4d8+3+Aabadbadbee at abeebdee 0:3:foo.txt 1:0:bar.txt 0:3:foo.txt\n"
+        reader = arvados.CollectionReader(
+            nonnormal,
+            api_client=client, num_retries=0)
+        # Ensure stripped_manifest() doesn't mangle our manifest in
+        # any way other than stripping hints.
         self.assertEqual(
-            ". acbd18db4cc2f85cedef654fccc4a4d8+3 0:3:foo.txt 1:0:bar.txt 0:3:foo.txt\n",
-            arvados.CollectionReader(
-                nonnormal,
-                api_client=client, num_retries=0).stripped_manifest())
+            re.replace('\+[^\d\+]+', '', nonnormal),
+            reader.stripped_manifest())
+        # Ensure stripped_manifest() didn't mutate our reader.
+        self.assertEqual(nonnormal, reader.manifest_text())
+        # Ensure the files appear in the order given in the manifest.
         self.assertEqual(
             [[6, '.', 'foo.txt'],
              [0, '.', 'bar.txt']],
             [[f.size(), f.stream_name(), f.name()]
-             for f in
-             arvados.CollectionReader(
-                    nonnormal,
-                    api_client=client, num_retries=0).all_streams()[0].all_files()])
+             for f in reader.all_streams()[0].all_files()])
 
 
 @tutil.skip_sleep

commit 55a0e060233385a9be029d0e75c152307950e268
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Oct 31 19:36:49 2014 -0400

    3706: Prefer join() to many string concatenations.

diff --git a/sdk/python/arvados/collection.py b/sdk/python/arvados/collection.py
index f7d210d..82ef156 100644
--- a/sdk/python/arvados/collection.py
+++ b/sdk/python/arvados/collection.py
@@ -89,14 +89,17 @@ class CollectionBase(object):
         hints other than size hints) removed from the locators.
         """
         raw = self.manifest_text()
-        clean = ''
+        clean = []
         for line in raw.split("\n"):
             fields = line.split()
             if fields:
-                locators = [ (re.sub(r'\+[^\d][^\+]*', '', x) if re.match(util.keep_locator_pattern, x) else x)
-                             for x in fields[1:-1] ]
-                clean += fields[0] + ' ' + ' '.join(locators) + ' ' + fields[-1] + "\n"
-        return clean
+                clean_fields = fields[:1] + [
+                    (re.sub(r'\+[^\d][^\+]*', '', x)
+                     if re.match(util.keep_locator_pattern, x)
+                     else x)
+                    for x in fields[1:]]
+                clean += [' '.join(clean_fields), "\n"]
+        return ''.join(clean)
 
 
 class CollectionReader(CollectionBase):

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list