# HG changeset patch # User Jeff Hammel # Date 1355775894 28800 # Node ID 7138a453ecf72d6dbcc4f3ae829f0d864e6f08e0 # Parent 6c1ca906ffa44edea2689157e9a48f9b32bd2fea WIP diff -r 6c1ca906ffa4 -r 7138a453ecf7 bzgit.py --- a/bzgit.py Mon Dec 17 11:32:47 2012 -0800 +++ b/bzgit.py Mon Dec 17 12:24:54 2012 -0800 @@ -10,6 +10,7 @@ import sys import urlparse from pygithub3 import Github +from bzconsole.command import read_dotfile # XXX to be moved def path_segments(path): """return path segments""" @@ -56,11 +57,25 @@ # connect to gh gh = Github() # TODO: auth pull = gh.pull_requests.get(pull_request, github_user, github_project) + title = pull.title + diff = pull.diff_url # move all the things - bz = bzconsole.BZapi() -# new = bz.new() -# + bz_options = read_dotfile() + assert set(['username', 'password']).issubset(bz_options) + bz = bzconsole.BZapi(**bz_options) + + description = """From %s: + +%s +""" % (resource, title) + + # TODO: add CC of github user if possible + cc = [':wlach'] + new = bz.new('Mozbase', title=title, description=description, cc=cc) + bug = int(new.strip().rsplit('/')[-1]) + import pdb; pdb.set_trace() +# attachment = bz.attach(bug, diff, reviewer=':wlach') # comment on pull request wrt bugzilla.m.o issue location # TODO