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

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sat Oct 19 01:14:59 EDT 2019


martinvonz added a comment.


  In D7135#104894 <https://phab.mercurial-scm.org/D7135#104894>, @yuja wrote:
  
  >> - 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 <https://phab.mercurial-scm.org/rHGa43fdf33a6beb697945a3dbb7253f0436ea278a6>, which might need bad copy information.
  
  Ah, so maybe the bug used to be incorrectly suppressed by the logic for finding the source in an old version. Thanks for digging that up. I somehow didn't think to check.
  
  >> - a/mercurial/copies.py
  >>
  >> +++ b/mercurial/copies.py
  >> @@ -810,10 +810,11 @@
  >>
  >> 1. of the function is much faster (and is required for carrying copy
  >> 2. 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.
  
  Yes, exactly. I should have mentioned that.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7135/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7135

To: martinvonz, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list