def autoincrement_tag(last_tag):
    """
    autoincrement_tag('1') => 2
    autoincrement_tag('1.2') => 1.3
    autoincrement_tag('1.2.3') => 1.2.4
    """
    tokens = last_tag.split('.')
    r = int(tokens[-1]) + 1
    if len(tokens) > 1:
        return '%s.%s' % ('.'.join(tokens[0:-1]), r)
    else:
        return str(r)