mercurial/copies.py
changeset 46482 892eb7c5edaa
parent 46480 e948ad0dcbe2
child 46606 c692384bb559
equal deleted inserted replaced
46481:29e3e46b0a22 46482:892eb7c5edaa
  1227     by merge.update().
  1227     by merge.update().
  1228     """
  1228     """
  1229     new_copies = pathcopies(base, ctx)
  1229     new_copies = pathcopies(base, ctx)
  1230     parent = wctx.p1()
  1230     parent = wctx.p1()
  1231     _filter(parent, wctx, new_copies)
  1231     _filter(parent, wctx, new_copies)
  1232     # extra filtering to drop copy information for files that existed before
  1232     # Extra filtering to drop copy information for files that existed before
  1233     # the graft (otherwise we would create merge filelog for non-merge commit
  1233     # the graft. This is to handle the case of grafting a rename onto a commit
       
  1234     # that already has the rename. Otherwise the presence of copy information
       
  1235     # would result in the creation of an empty commit where we would prefer to
       
  1236     # not create one.
  1234     for dest, __ in list(new_copies.items()):
  1237     for dest, __ in list(new_copies.items()):
  1235         if dest in parent:
  1238         if dest in parent:
  1236             del new_copies[dest]
  1239             del new_copies[dest]
  1237     for dst, src in pycompat.iteritems(new_copies):
  1240     for dst, src in pycompat.iteritems(new_copies):
  1238         wctx[dst].markcopied(src)
  1241         wctx[dst].markcopied(src)