Mercurial > hg
comparison hgext/rebase.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 | 93fcd65e459f |
children | 44c4ed4ad032 |
comparison
equal
deleted
inserted
replaced
34786:9c899660700a | 34787:754b5117622f |
---|---|
975 repo.ui.debug(" merge against %d:%s\n" % (rev, repo[rev])) | 975 repo.ui.debug(" merge against %d:%s\n" % (rev, repo[rev])) |
976 if base is not None: | 976 if base is not None: |
977 repo.ui.debug(" detach base %d:%s\n" % (base, repo[base])) | 977 repo.ui.debug(" detach base %d:%s\n" % (base, repo[base])) |
978 # When collapsing in-place, the parent is the common ancestor, we | 978 # When collapsing in-place, the parent is the common ancestor, we |
979 # have to allow merging with it. | 979 # have to allow merging with it. |
980 wctx = repo[None] | |
980 stats = mergemod.update(repo, rev, True, True, base, collapse, | 981 stats = mergemod.update(repo, rev, True, True, base, collapse, |
981 labels=['dest', 'source']) | 982 labels=['dest', 'source']) |
982 if collapse: | 983 if collapse: |
983 copies.duplicatecopies(repo, rev, dest) | 984 copies.duplicatecopies(repo, wctx, rev, dest) |
984 else: | 985 else: |
985 # If we're not using --collapse, we need to | 986 # If we're not using --collapse, we need to |
986 # duplicate copies between the revision we're | 987 # duplicate copies between the revision we're |
987 # rebasing and its first parent, but *not* | 988 # rebasing and its first parent, but *not* |
988 # duplicate any copies that have already been | 989 # duplicate any copies that have already been |
989 # performed in the destination. | 990 # performed in the destination. |
990 p1rev = repo[rev].p1().rev() | 991 p1rev = repo[rev].p1().rev() |
991 copies.duplicatecopies(repo, rev, p1rev, skiprev=dest) | 992 copies.duplicatecopies(repo, wctx, rev, p1rev, skiprev=dest) |
992 return stats | 993 return stats |
993 | 994 |
994 def adjustdest(repo, rev, destmap, state, skipped): | 995 def adjustdest(repo, rev, destmap, state, skipped): |
995 """adjust rebase destination given the current rebase state | 996 """adjust rebase destination given the current rebase state |
996 | 997 |