about = ""
- if not cl.lgtm and not opts.get('tbr') and not isAddca(cl):
+ if not cl.lgtm and not opts.get('tbr') and needLGTM(cl):
raise hg_util.Abort("this CL has not been LGTM'ed")
if cl.lgtm:
about += "LGTM=" + JoinComma([CutDomain(who) for (who, line, approval) in cl.lgtm if approval]) + "\n"
return err
return 0
-def isAddca(cl):
+def needLGTM(cl):
rev = cl.reviewer
isGobot = 'gobot' in rev or 'gobot@swtch.com' in rev or 'gobot@golang.org' in rev
- return cl.desc.startswith('A+C:') and 'Generated by addca.' in cl.desc and isGobot
+
+ # A+C CLs generated by addca do not need LGTM
+ if cl.desc.startswith('A+C:') and 'Generated by addca.' in cl.desc and isGobot:
+ return False
+
+ # CLs modifying only go1.x.txt do not need LGTM
+ if len(cl.files) == 1 and cl.files[0].startswith('doc/go1.') and cl.files[0].endswith('.txt'):
+ return False
+
+ # Other CLs need LGTM
+ return True
#######################################################################
# hg sync