Rev 5140: We should supply pocket=Release when none is supplied. in http://bazaar.launchpad.net/~jameinel/bzr/2.2-is-up-to-date

John Arbash Meinel john at arbash-meinel.com
Wed Jul 13 13:36:09 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/2.2-is-up-to-date

------------------------------------------------------------
revno: 5140
revision-id: john at arbash-meinel.com-20110713133536-fdi48h5vb3f95160
parent: john at arbash-meinel.com-20110713131444-mxlj59c9h6n6qybu
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.2-is-up-to-date
timestamp: Wed 2011-07-13 15:35:36 +0200
message:
  We should supply pocket=Release when none is supplied.
  
  Otherwise when querying 'lp:ubuntu/natty/bzr' we see the revision that
  is only present in 'lp:ubuntu/natty-proposed/bzr'.
-------------- next part --------------
=== modified file 'bzrlib/plugins/launchpad/lp_api_lite.py'
--- a/bzrlib/plugins/launchpad/lp_api_lite.py	2011-07-13 12:22:27 +0000
+++ b/bzrlib/plugins/launchpad/lp_api_lite.py	2011-07-13 13:35:36 +0000
@@ -64,6 +64,8 @@
         if self._series is not None and '-' in self._series:
             self._series, self._pocket = self._series.split('-', 1)
             self._pocket = self._pocket.title()
+        else:
+            self._pocket = 'Release'
 
     def _archive_URL(self):
         """Return the Launchpad 'Archive' URL that we will query.

=== modified file 'bzrlib/plugins/launchpad/test_lp_api_lite.py'
--- a/bzrlib/plugins/launchpad/test_lp_api_lite.py	2011-07-13 12:22:27 +0000
+++ b/bzrlib/plugins/launchpad/test_lp_api_lite.py	2011-07-13 13:35:36 +0000
@@ -80,7 +80,7 @@
         self.assertEqual('ubuntu', latest_pub._archive)
         self.assertEqual('natty', latest_pub._series)
         self.assertEqual('bzr', latest_pub._project)
-        self.assertEqual(None, latest_pub._pocket)
+        self.assertEqual('Release', latest_pub._pocket)
 
     def test__archive_URL(self):
         latest_pub = self.make_latest_publication()
@@ -106,7 +106,7 @@
         self.assertEqual('ubuntu', latest_pub._archive)
         self.assertEqual(None, latest_pub._series)
         self.assertEqual('bzr', latest_pub._project)
-        self.assertEqual(None, latest_pub._pocket)
+        self.assertEqual('Release', latest_pub._pocket)
 
     def test__query_params(self):
         latest_pub = self.make_latest_publication()
@@ -116,6 +116,7 @@
                           'status': 'Published',
                           'ws.size': '1',
                           'distro_series': '/ubuntu/natty',
+                          'pocket': 'Release',
                          }, latest_pub._query_params())
 
     def test__query_params_no_series(self):
@@ -125,6 +126,7 @@
                           'source_name': '"bzr"',
                           'status': 'Published',
                           'ws.size': '1',
+                          'pocket': 'Release',
                          }, latest_pub._query_params())
 
     def test__query_params_pocket(self):
@@ -144,7 +146,7 @@
         self.assertEqual(
             'https://api.launchpad.net/1.0/ubuntu/+archive/primary'
             '?distro_series=%2Fubuntu%2Fnatty&exact_match=true'
-            '&source_name=%22bzr%22&status=Published'
+            '&pocket=Release&source_name=%22bzr%22&status=Published'
             '&ws.op=getPublishedSources&ws.size=1',
             latest_pub._query_URL())
 



More information about the bazaar-commits mailing list