<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _create_tag_lowlevel(self, tag_name, message=None, force=True, patch=False):
 """Create a tag on the toplevel or patch repo If the tag exists, and force is False, no tag is made. If force is True, and a tag exists, but it is a direct ancestor of the current commit, and there is no difference in filestate between the current commit and the tagged commit, no tag is made. Otherwise, the old tag is overwritten to point at the current commit. Returns True or False indicating whether the tag was actually committed """

        # check if tag already exists, and if it does, if it is a direct
        # ancestor, and there is NO difference in the files between the tagged
        # state and current state
        #
        # This check is mainly to avoid re-creating the same tag over and over
        # on what is essentially the same commit, since tagging will
        # technically create a new commit, and update the working copy to it.
        #
        # Without this check, say you were releasing to three different
        # locations, one right after another; the first would create the tag,
        # and a new tag commit.  The second would then recreate the exact same
        # tag, but now pointing at the commit that made the first tag.
        # The third would create the tag a THIRD time, but now pointing at the
        # commit that created the 2nd tag.
        tags = self.get_tags(patch=patch)

        old_commit = tags.get(tag_name)
        if old_commit is not None:
            if not force:
                return False
            old_rev = old_commit['rev']
            # ok, now check to see if direct ancestor...
            if self.is_ancestor(old_rev, '.', patch=patch):
                # ...and if filestates are same
                altered = self.hg('status', '--rev', old_rev, '--rev', '.',
                                  '--no-status')
                if not altered or altered == ['.hgtags']:
                    force = False
            if not force:
                return False

        tag_args = ['tag', tag_name]
        if message:
            tag_args += ['--message', message]

        # we should be ok with ALWAYS having force flag on now, since we should
        # have already checked if the commit exists.. but be paranoid, in case
        # we've missed some edge case...
        if force:
            tag_args += ['--force']
        self.hg(patch=patch, *tag_args)
        return True