← Back to team overview

launchpad-reviewers team mailing list archive

lp:~julian-edwards/launchpad/use-existing-packagediffs-bug-768376 into lp:launchpad

 

Julian Edwards has proposed merging lp:~julian-edwards/launchpad/use-existing-packagediffs-bug-768376 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~julian-edwards/launchpad/use-existing-packagediffs-bug-768376/+merge/58696

= Summary =
populate_distroseriesdiff.py does not detect existing packagediffs, we're
fixing that here.

== Pre-implementation notes ==
SteveK says that the script should be calling DSD.update() which will DTRT,
not the _updateBaseVersion() method, which doesn't!

== Implementation details ==
As above.

== Tests ==
bin/test -cvv test_populate_distroseriesdiff

== Demo and Q/A ==
We'll re-run the script on staging and make sure it works.


= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/registry/scripts/populate_distroseriesdiff.py
  lib/lp/registry/scripts/tests/test_populate_distroseriesdiff.py

./lib/lp/registry/scripts/tests/test_populate_distroseriesdiff.py
     135: local variable 'spr' is assigned to but never used
     153: local variable 'primary_spr' is assigned to but never used
     182: local variable 'spphs' is assigned to but never used
     335: local variable 'derived_spph' is assigned to but never used
     435: local variable 'store' is assigned to but never used
     565: local variable 'spph' is assigned to but never used
-- 
https://code.launchpad.net/~julian-edwards/launchpad/use-existing-packagediffs-bug-768376/+merge/58696
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~julian-edwards/launchpad/use-existing-packagediffs-bug-768376 into lp:launchpad.
=== modified file 'lib/lp/registry/scripts/populate_distroseriesdiff.py'
--- lib/lp/registry/scripts/populate_distroseriesdiff.py	2011-04-12 11:26:43 +0000
+++ lib/lp/registry/scripts/populate_distroseriesdiff.py	2011-04-21 15:00:00 +0000
@@ -273,7 +273,7 @@
     def __call__(self, chunk_size):
         """See `ITunableLoop`."""
         for dsd in self._getBatch(self._cutChunk(int(chunk_size))):
-            dsd._updateBaseVersion()
+            dsd.update()
         self.commit()
 
 

=== modified file 'lib/lp/registry/scripts/tests/test_populate_distroseriesdiff.py'
--- lib/lp/registry/scripts/tests/test_populate_distroseriesdiff.py	2011-04-12 10:34:13 +0000
+++ lib/lp/registry/scripts/tests/test_populate_distroseriesdiff.py	2011-04-21 15:00:00 +0000
@@ -468,7 +468,7 @@
 
 
 class FakeDSD:
-    _updateBaseVersion = FakeMethod()
+    update = FakeMethod()
 
 
 class TestBaseVersionFixer(TestCase):
@@ -502,7 +502,7 @@
         fixer = self.makeFixer([fake_dsd])
         fixer._getBatch.result = fixer.ids
         fixer(1)
-        self.assertNotEqual(0, fake_dsd._updateBaseVersion.call_count)
+        self.assertNotEqual(0, fake_dsd.update.call_count)
 
     def test_loop_commits(self):
         fixer = self.makeFixer([FakeDSD()])