##// 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 977 repo.ui.debug(" detach base %d:%s\n" % (base, repo[base]))
978 978 # When collapsing in-place, the parent is the common ancestor, we
979 979 # have to allow merging with it.
980 wctx = repo[None]
980 981 stats = mergemod.update(repo, rev, True, True, base, collapse,
981 982 labels=['dest', 'source'])
982 983 if collapse:
983 copies.duplicatecopies(repo, rev, dest)
984 copies.duplicatecopies(repo, wctx, rev, dest)
984 985 else:
985 986 # If we're not using --collapse, we need to
986 987 # duplicate copies between the revision we're
@@ -988,7 +989,7 b' def rebasenode(repo, rev, p1, base, stat'
988 989 # duplicate any copies that have already been
989 990 # performed in the destination.
990 991 p1rev = repo[rev].p1().rev()
991 copies.duplicatecopies(repo, rev, p1rev, skiprev=dest)
992 copies.duplicatecopies(repo, wctx, rev, p1rev, skiprev=dest)
992 993 return stats
993 994
994 995 def adjustdest(repo, rev, destmap, state, skipped):
@@ -1935,6 +1935,11 b' class workingfilectx(committablefilectx)'
1935 1935 self._repo.wwrite(self._path, data, flags,
1936 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 1943 def clearunknown(self):
1939 1944 """Removes conflicting items in the working directory so that
1940 1945 ``write()`` can be called successfully.
@@ -842,7 +842,7 b' def _checkcopies(srcctx, dstctx, f, base'
842 842 data['incompletediverge'][sf] = [of, f]
843 843 return
844 844
845 def duplicatecopies(repo, rev, fromrev, skiprev=None):
845 def duplicatecopies(repo, wctx, rev, fromrev, skiprev=None):
846 846 '''reproduce copies from fromrev to rev in the dirstate
847 847
848 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 863 # actually be in the dirstate
864 864 if dst in exclude:
865 865 continue
866 if repo.dirstate[dst] in "nma":
867 repo.dirstate.copy(src, dst)
866 wctx[dst].markcopied(src)
@@ -2001,5 +2001,5 b' def graft(repo, ctx, pctx, labels, keepp'
2001 2001 repo.setparents(repo['.'].node(), pother)
2002 2002 repo.dirstate.write(repo.currenttransaction())
2003 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 2005 return stats
General Comments 0
You need to be logged in to leave comments. Login now