mercurial/localrepo.py
changeset 22405 6f63c47cbb86
parent 22404 12bc7f06fc41
child 22502 e6e7ef68c879
equal deleted inserted replaced
22404:12bc7f06fc41 22405:6f63c47cbb86
   756     def parents(self, changeid=None):
   756     def parents(self, changeid=None):
   757         '''get list of changectxs for parents of changeid'''
   757         '''get list of changectxs for parents of changeid'''
   758         return self[changeid].parents()
   758         return self[changeid].parents()
   759 
   759 
   760     def setparents(self, p1, p2=nullid):
   760     def setparents(self, p1, p2=nullid):
       
   761         self.dirstate.beginparentchange()
   761         copies = self.dirstate.setparents(p1, p2)
   762         copies = self.dirstate.setparents(p1, p2)
   762         pctx = self[p1]
   763         pctx = self[p1]
   763         if copies:
   764         if copies:
   764             # Adjust copy records, the dirstate cannot do it, it
   765             # Adjust copy records, the dirstate cannot do it, it
   765             # requires access to parents manifests. Preserve them
   766             # requires access to parents manifests. Preserve them
   769                     self.dirstate.copy(copies[f], f)
   770                     self.dirstate.copy(copies[f], f)
   770         if p2 == nullid:
   771         if p2 == nullid:
   771             for f, s in sorted(self.dirstate.copies().items()):
   772             for f, s in sorted(self.dirstate.copies().items()):
   772                 if f not in pctx and s not in pctx:
   773                 if f not in pctx and s not in pctx:
   773                     self.dirstate.copy(None, f)
   774                     self.dirstate.copy(None, f)
       
   775         self.dirstate.endparentchange()
   774 
   776 
   775     def filectx(self, path, changeid=None, fileid=None):
   777     def filectx(self, path, changeid=None, fileid=None):
   776         """changeid can be a changeset revision, node, or tag.
   778         """changeid can be a changeset revision, node, or tag.
   777            fileid can be a file revision or node."""
   779            fileid can be a file revision or node."""
   778         return context.filectx(self, path, changeid, fileid)
   780         return context.filectx(self, path, changeid, fileid)