D7135: copies: filter out file already in parent in duplicatecopies()

Yuya Nishihara yuya at tcha.org
Sat Oct 19 01:07:46 EDT 2019


> --- a/tests/test-issue1175.t
> +++ b/tests/test-issue1175.t
> @@ -82,7 +82,6 @@
>    continue: hg graft --continue
>    $ hg graft --continue
>    grafting 1:5974126fad84 "b1"
> -  warning: can't find ancestor for 'b' copied from 'a'!
>    $ hg log -f b -T 'changeset:   {rev}:{node|short}\nsummary:     {desc}\n\n'
>    changeset:   3:376d30ccffc0
>    summary:     b1

This test was added at a43fdf33a6be, which might need bad copy information.

> --- a/mercurial/copies.py
> +++ b/mercurial/copies.py
> @@ -810,10 +810,11 @@
>          # of the function is much faster (and is required for carrying copy
>          # metadata across the rebase anyway).
>          exclude = pathcopies(repo[fromrev], repo[skiprev])
> +    pctx = wctx.p1()
>      for dst, src in pycompat.iteritems(pathcopies(repo[fromrev], repo[rev])):
>          if dst in exclude:
>              continue
> -        if dst in wctx:
> +        if dst in wctx and dst not in pctx:
>              wctx[dst].markcopied(src)

Seems fine as we don't support `hg rm b; hg cp a b` case.


More information about the Mercurial-devel mailing list