<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def commit(context, message, name):
 """Commit saved changes to the repository. message - commit message name - tag name """

    context.obj.find_repo_type()
    if context.obj.vc_name == 'git':
        context.obj.call(['git', 'commit', '-a', '-m', message])
    elif context.obj.vc_name == 'hg':
        context.obj.call(['hg', 'commit', '-m', message])
    if name != '' and context.obj.vc_name == 'git':
        context.obj.call(['git', 'tag', '-a', name, '-m', message])
    elif name != '' and context.obj.vc_name == 'hg':
        context.obj.call(['hg', 'tag', '-m', message, name])