##// END OF EJS Templates
context: add workingfilectx.markcopied...
Phil Cohen -
r34788:754b5117 default
parent child Browse files
Show More
@@ -977,10 +977,11 b' def rebasenode(repo, rev, p1, base, stat'
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
@@ -988,7 +989,7 b' def rebasenode(repo, rev, p1, base, stat'
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):
@@ -1935,6 +1935,11 b' class workingfilectx(committablefilectx)'
1935 self._repo.wwrite(self._path, data, flags,
1935 self._repo.wwrite(self._path, data, flags,
1936 backgroundclose=backgroundclose)
1936 backgroundclose=backgroundclose)
1937
1937
1938 def markcopied(self, src):
1939 """marks this file a copy of `src`"""
1940 if self._repo.dirstate[self._path] in "nma":
1941 self._repo.dirstate.copy(src, self._path)
1942
1938 def clearunknown(self):
1943 def clearunknown(self):
1939 """Removes conflicting items in the working directory so that
1944 """Removes conflicting items in the working directory so that
1940 ``write()`` can be called successfully.
1945 ``write()`` can be called successfully.
@@ -842,7 +842,7 b' def _checkcopies(srcctx, dstctx, f, base'
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
@@ -863,5 +863,4 b' def duplicatecopies(repo, rev, fromrev, '
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)
@@ -2001,5 +2001,5 b' def graft(repo, ctx, pctx, labels, keepp'
2001 repo.setparents(repo['.'].node(), pother)
2001 repo.setparents(repo['.'].node(), pother)
2002 repo.dirstate.write(repo.currenttransaction())
2002 repo.dirstate.write(repo.currenttransaction())
2003 # fix up dirstate for copies and renames
2003 # fix up dirstate for copies and renames
2004 copies.duplicatecopies(repo, ctx.rev(), pctx.rev())
2004 copies.duplicatecopies(repo, repo[None], ctx.rev(), pctx.rev())
2005 return stats
2005 return stats
General Comments 0
You need to be logged in to leave comments. Login now