/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tools/check-newsbugs.py

  • Committer: Robert Collins
  • Date: 2010-06-25 20:34:05 UTC
  • mto: This revision was merged to the branch mainline in revision 5324.
  • Revision ID: robertc@robertcollins.net-20100625203405-c74lxd3enklhaqf9
``bzrlib.osutils.get_terminal_encoding`` will now only mutter its
selection when explicitly requested; this avoids many duplicate calls
being logged when helpers, wrappers and older code that manually calls
it are executed it is now logged deliberately by the ui setup code.
(Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
import getopt, re, sys
6
6
try:
7
 
    from launchpadbugs import connector
 
7
    from launchpadlib.launchpad import Launchpad
8
8
except ImportError:
9
 
    print "Please install launchpadbugs from lp:python-launchpad-bugs"
 
9
    print "Please install launchpadlib from lp:launchpadlib"
10
10
    sys.exit(1)
11
11
 
12
12
options, args = getopt.gnu_getopt(sys.argv, "l", ["launchpad"])
22
22
 
23
23
def report_notmarked(bug, task, section):
24
24
    print 
25
 
    print "Bug %d was mentioned in NEWS but is not marked fix released:" % (bug.bugnumber, )
 
25
    print "Bug %d was mentioned in NEWS but is not marked fix released:" % (bug.id, )
26
26
    print "Launchpad title: %s" % bug.title
27
27
    print "NEWS summary: "
28
28
    print section
29
29
    if "--launchpad" in options or "-l" in options:
30
 
        print "  bug %d" % bug.bugnumber
31
 
        print "  affects bzr"
 
30
        print "  bug %d" % bug.id
 
31
        print "  affects %s" % task.bug_target_name
32
32
        print "  status fixreleased"
33
33
 
34
34
 
60
60
    finally:
61
61
        f.close()
62
62
 
63
 
open_bug = connector.ConnectBug("TEXT")
 
63
 
 
64
lp = Launchpad.login_anonymously('bzr-check-newsbugs', 'edge', version='1.0')
64
65
 
65
66
bugnos = read_news_bugnos(args[1])
66
67
for bugno, section in bugnos:
67
 
    bug = open_bug(url="https://bugs.launchpad.net/bzr/+bug/%d" % bugno)
 
68
    bug = lp.bugs[bugno]
68
69
    found_bzr = False
69
 
    for task in bug.infotable:
70
 
        if task.affects == "bzr":
 
70
    for task in bug.bug_tasks:
 
71
        if task.bug_target_name == "bzr":
71
72
            found_bzr = True
72
73
            if task.status != "Fix Released":
73
74
                report_notmarked(bug, task, section)