[PATCH 2 of 3 STABLE] rename: properly report removed and added file as modified (issue4458)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Nov 27 00:44:35 UTC 2014



On 11/26/2014 04:26 PM, Martin von Zweigbergk wrote:
>     diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
>     --- a/mercurial/scmutil.py
>     +++ b/mercurial/scmutil.py
>     @@ -802,12 +802,16 @@ def dirstatecopy(ui, repo, wctx, src, ds
>               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])
>     +            if not dryrun:
>     +                if repo.dirstate[dst] == '?':
>     +                    wctx.add([dst])
>     +                elif repo.dirstate[dst] == 'r':
>     +                    repo.dirstate.normallookup(__dst)
>     +
>
>
> Would bypassing wctx.add() and going straight to
> repo.dirstate.normallookup() when the file had been previously removed
> be equivalent? It seems like that bypasses the warning about adding big
> files and odd file types. Is the thinking that that would have been
> already checked when the source was added? It would also bypass the
> repo.wlock(). I don't know if that has any effect. What's the reason for
> not calling wctx.add() in both cases?

You are right, this is useless and wrong rubbish. Uncommiting it and 
sending a V2.

-- 
Pierre-Yves David



More information about the Mercurial-devel mailing list