Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 44052:b74270da5eee
workingctx: move setparents() logic from localrepo to mirror overlayworkingctx
It would be nice to later be able to call `wctx.setparents()` whether
`wctx` is a `workingctx` or an `overlayworkingctx`.
Differential Revision: https://phab.mercurial-scm.org/D7823
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 10 Jan 2020 13:24:25 -0800 |
parents | b958419b6c53 |
children | a61287a95dc3 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Fri Jan 10 21:41:28 2020 -0800 +++ b/mercurial/localrepo.py Fri Jan 10 13:24:25 2020 -0800 @@ -1886,20 +1886,7 @@ return self.vfs.reljoin(self.root, f, *insidef) def setparents(self, p1, p2=nullid): - with self.dirstate.parentchange(): - copies = self.dirstate.setparents(p1, p2) - pctx = self[p1] - if copies: - # Adjust copy records, the dirstate cannot do it, it - # requires access to parents manifests. Preserve them - # only for entries added to first parent. - for f in copies: - if f not in pctx and copies[f] in pctx: - self.dirstate.copy(copies[f], f) - if p2 == nullid: - for f, s in sorted(self.dirstate.copies().items()): - if f not in pctx and s not in pctx: - self.dirstate.copy(None, f) + self[None].setparents(p1, p2) def filectx(self, path, changeid=None, fileid=None, changectx=None): """changeid must be a changeset revision, if specified.