Rev 5431: Tiny doc cleanups and tweaks for tools/check-newsbugs.py. in file:///home/vila/src/bzr/releases/work/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Sep 20 13:05:38 BST 2010


At file:///home/vila/src/bzr/releases/work/

------------------------------------------------------------
revno: 5431
revision-id: v.ladeuil+lp at free.fr-20100920120538-1xxzn8zcc2lr1cz8
parent: pqm at pqm.ubuntu.com-20100916070436-jm5qh2fgacocasc4
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: work
timestamp: Mon 2010-09-20 14:05:38 +0200
message:
  Tiny doc cleanups and tweaks for tools/check-newsbugs.py.
-------------- next part --------------
=== modified file 'doc/developers/ppa.txt'
--- a/doc/developers/ppa.txt	2010-09-13 02:03:04 +0000
+++ b/doc/developers/ppa.txt	2010-09-20 12:05:38 +0000
@@ -7,13 +7,13 @@
 Background
 ----------
 
-We build Ubuntu ``.deb`` packages for Bazaar as an important part of the release
-process.  These packages are hosted in a few `Personal Package Archives (PPA)`__ on
-Launchpad.
+We build Ubuntu ``.deb`` packages for Bazaar as an important part of the
+release process.  These packages are hosted in a few `Personal Package
+Archives (PPA)`__ on Launchpad.
 
   __ https://help.launchpad.net/PPAQuickStart
 
-As of June 2010, there are three PPAs:
+As of September 2010, there are four PPAs:
 
 <https://launchpad.net/~bzr/+archive/ppa>
     Final released versions and updates.

=== modified file 'tools/check-newsbugs.py'
--- a/tools/check-newsbugs.py	2010-06-01 16:46:47 +0000
+++ b/tools/check-newsbugs.py	2010-09-20 12:05:38 +0000
@@ -5,9 +5,16 @@
 import getopt, re, sys
 try:
     from launchpadlib.launchpad import Launchpad
+    from lazr.restfulclient import errors
 except ImportError:
     print "Please install launchpadlib from lp:launchpadlib"
     sys.exit(1)
+try:
+    import hydrazine
+except ImportError:
+    print "Please install hydrazine from lp:launchpadlib"
+    sys.exit(1)
+
 
 options, args = getopt.gnu_getopt(sys.argv, "l", ["launchpad"])
 options = dict(options)
@@ -61,16 +68,42 @@
         f.close()
 
 
-lp = Launchpad.login_anonymously('bzr-check-newsbugs', 'edge', version='1.0')
+def print_bug_url(bugno):
+    print '<URL:http://pad.lv/%s>' % (bugno,)
 
+launchpad = hydrazine.create_session()
 bugnos = read_news_bugnos(args[1])
 for bugno, section in bugnos:
-    bug = lp.bugs[bugno]
+    try:
+        bug = launchpad.bugs[bugno]
+    except errors.HTTPError, e:
+        if e.response.status == 401:
+            print_bug_url(bugno)
+            # Private, we can't access the bug content
+            print '%s is private and cannot be accessed' % (bugno,)
+            continue
+        raise
+     
     found_bzr = False
+    fix_released = False
     for task in bug.bug_tasks:
-        if task.bug_target_name == "bzr":
+        parts = task.bug_target_name.split('/')
+        if len(parts) == 1:
+            project = parts[0]
+            distribution = None
+        else:
+            project = parts[0]
+            distribution = parts[1]
+        if project == "bzr":
             found_bzr = True
-            if task.status != "Fix Released":
-                report_notmarked(bug, task, section)
+            if not fix_released and task.status == "Fix Released":
+                # We could check that the NEWS section and task_status are in
+                # sync, but that would be overkill. (case at hand: bug #416732)
+                fix_released = True
+
     if not found_bzr:
+        print_bug_url(bugno)
         print "Bug %d was mentioned in NEWS but is not marked as affecting bzr" % bugno
+    elif not fix_released:
+        print_bug_url(bugno)
+        report_notmarked(bug, task, section)



More information about the bazaar-commits mailing list