def dirstatecopy(ui, repo, wctx, src, dst, dryrun=False, cwd=None):
    """Update the dirstate to reflect the intent of copying src to dst. For
    different reasons it might not end with dst being marked as copied from src.
    """
    origsrc = repo.dirstate.copied(src) or src
    if dst == origsrc:  # copying back a copy?
        if repo.dirstate[dst] not in "mn" and not dryrun:
            repo.dirstate.normallookup(dst)
    else:
        if repo.dirstate[origsrc] == "a" and origsrc == src:
            if not ui.quiet:
                ui.warn(
                    _(
                        "%s has not been committed yet, so no copy "
                        "data will be stored for %s.\n"
                    )
                    % (repo.pathto(origsrc, cwd), repo.pathto(dst, cwd))
                )
            if repo.dirstate[dst] in "?r" and not dryrun:
                wctx.add([dst])
        elif not dryrun:
            wctx.copy(origsrc, dst)