public
Created

Axel's hack to review aurora sign-offs, with multi-diffs for disconnected changesets

  • Download Gist
aurora_review.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
from shipping.models import *
from life.models import Changeset
from shipping.views import _signoffs
difft = 'https://l10n-stage-sj.mozilla.org/shipping/diff?repo=%s&from=%s&to=%s'
aurorabase='releases/l10n/mozilla-aurora/'
app = 'fennec'
av=AppVersion.objects.get(code=app+'-aurora')
sos=_signoffs(av,getlist=True)
m401=Milestone.objects.get(code=app+'4.0.1')
sos4=m401.signoffs
l2s4=dict((so.locale.code,so) for so in sos4.select_related('locale','push'))
for (tree, loc), stati in sos.iteritems():
if 0 not in stati: continue
so = _signoffs(av, locale=loc, status=0)
_from = l2s4[loc].push.tip
_to = so.push.tip
if _from.repositories.filter(id__in=_to.repositories.all()).count() < 1:
# need to find a common base
frepo = _from.repositories.all()[0]
trepo = _to.repositories.all()[0]
baseq = Changeset.objects.order_by('-pk').filter(branch=1)
baseq = baseq.filter(repositories=frepo)
baseq = baseq.filter(repositories=trepo)
base = baseq[0]
if base.id == 1:
print "XXXX, disconnected repos for "+loc
continue
print difft % (frepo.name, base.shortrev, _from.shortrev)
print ' ', difft % (trepo.name, base.shortrev, _to.shortrev)
else:
print difft % (aurorabase+loc,l2s4[loc].push.tip.shortrev,so.push.tip.shortrev)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.