Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/copies.py @ 34787:754b5117622f
context: add workingfilectx.markcopied
With in-memory merge, copy information needs to be stored in-memory, not in the
dirstate.
To make this transition easy, move the existing dirstate-based approach to
workingfilectx; that way, other implementations can choose to store it
somewhere else.
Differential Revision: https://phab.mercurial-scm.org/D1106
author | Phil Cohen <phillco@fb.com> |
---|---|
date | Sun, 15 Oct 2017 20:36:29 -0700 |
parents | e79b3611223b |
children | f05a6e015ecc |
comparison
equal
deleted
inserted
replaced
34786:9c899660700a | 34787:754b5117622f |
---|---|
840 data['diverge'].setdefault(sf, []).append(f) | 840 data['diverge'].setdefault(sf, []).append(f) |
841 else: | 841 else: |
842 data['incompletediverge'][sf] = [of, f] | 842 data['incompletediverge'][sf] = [of, f] |
843 return | 843 return |
844 | 844 |
845 def duplicatecopies(repo, rev, fromrev, skiprev=None): | 845 def duplicatecopies(repo, wctx, rev, fromrev, skiprev=None): |
846 '''reproduce copies from fromrev to rev in the dirstate | 846 '''reproduce copies from fromrev to rev in the dirstate |
847 | 847 |
848 If skiprev is specified, it's a revision that should be used to | 848 If skiprev is specified, it's a revision that should be used to |
849 filter copy records. Any copies that occur between fromrev and | 849 filter copy records. Any copies that occur between fromrev and |
850 skiprev will not be duplicated, even if they appear in the set of | 850 skiprev will not be duplicated, even if they appear in the set of |
861 for dst, src in pathcopies(repo[fromrev], repo[rev]).iteritems(): | 861 for dst, src in pathcopies(repo[fromrev], repo[rev]).iteritems(): |
862 # copies.pathcopies returns backward renames, so dst might not | 862 # copies.pathcopies returns backward renames, so dst might not |
863 # actually be in the dirstate | 863 # actually be in the dirstate |
864 if dst in exclude: | 864 if dst in exclude: |
865 continue | 865 continue |
866 if repo.dirstate[dst] in "nma": | 866 wctx[dst].markcopied(src) |
867 repo.dirstate.copy(src, dst) |