'Run the script.
@type args: L{list} of L{str}
@param args: The command line arguments to process. This must contain
one string: the path to the root of the Twisted checkout.'

def main(self, args):

    if (len(args) != 1):
        sys.exit('Must    specify    one    argument:    the    Twisted    checkout')
    location = os.path.abspath(args[0])
    branch = runCommand(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], cwd=location).decode(sys.stdout.encoding).strip()
    r = runCommand(['git', 'diff', '--name-only', 'origin/trunk...'], cwd=location).decode(sys.stdout.encoding).strip()
    if (not r):
        self._print('On    trunk    or    no    diffs    from    trunk;    no    need    to    look    at    this.')
        sys.exit(0)
    files = r.strip().split(os.linesep)
    self._print('Looking    at    these    files:')
    for change in files:
        self._print(change)
    self._print('----')
    if (len(files) == 1):
        if (files[0] == os.sep.join(['docs', 'fun', 'Twisted.Quotes'])):
            self._print('Quotes    change    only;    no    newsfragment    needed.')
            sys.exit(0)
    newsfragments = []
    for change in files:
        if (((os.sep + 'newsfragments') + os.sep) in change):
            if (('.' in change) and (change.rsplit('.', 1)[1] in NEWSFRAGMENT_TYPES)):
                newsfragments.append(change)
    if branch.startswith('release-'):
        if newsfragments:
            self._print('No    newsfragments    should    be    on    the    release    branch.')
            sys.exit(1)
        else:
            self._print('Release    branch    with    no    newsfragments,    all    good.')
            sys.exit(0)
    for change in newsfragments:
        self._print(('Found    ' + change))
        sys.exit(0)
    self._print('No    newsfragment    found.    Have    you    committed    it?')
    sys.exit(1)
