@classmethod
    def callback(cls, args, argv):
        current_branch = utils.get_current_branch()
        if not utils.in_clean_state():
            print 'Branch %r not in clean state:' % (current_branch,)
            print utils.capture_command('git', 'diff', single_line=False)
            return

        if args.no_mail and args.send_patch:
            raise GitRvException('The flags --no_mail and --send_patch are '
                                 'mutually exclusive.')
        # This is to determine whether or not --send_mail should be added to
        # the upload.py call. If --send_patch is set, we don't need to
        # send mail. Similarly if --no_mail is set, we should not send mail.
        no_send_mail = args.no_mail or args.send_patch

        # Rietveld treats an empty string the same as if the value
        # was never set.
        if args.message and not args.title:
            raise GitRvException('A patch description can only be set if it '
                                 'also has a title.')

        commit_subject = commit_description = None
        if args.title:
            if len(args.title) > 100:
                raise GitRvException(utils.SUBJECT_TOO_LONG_TEMPLATE %
                                     (args.title,))
            # If args.message is '', then both the Title and Description
            # will take the value of the title.
            commit_subject = args.title
            commit_description = args.message or ''

        return cls(current_branch, args, commit_subject=commit_subject,
                   commit_description=commit_description,
                   no_send_mail=no_send_mail, argv=argv)
A callback to begin an ExportAction after arguments are parsed.
dataset/ETHPy150Open googlearchive/git-rv/export.py/ExportAction.callback