comparison mercurial/localrepo.py @ 18743:70e2a22fd66e

merge with stable
author Kevin Bullock <kbullock@ringworld.org>
date Fri, 01 Mar 2013 10:05:37 -0600
parents 7790d69af6d6 5b7175377bab
children 0377352eb7d3
comparison
equal deleted inserted replaced
18742:a07be8953733 18743:70e2a22fd66e
703 '''get list of changectxs for parents of changeid''' 703 '''get list of changectxs for parents of changeid'''
704 return self[changeid].parents() 704 return self[changeid].parents()
705 705
706 def setparents(self, p1, p2=nullid): 706 def setparents(self, p1, p2=nullid):
707 copies = self.dirstate.setparents(p1, p2) 707 copies = self.dirstate.setparents(p1, p2)
708 pctx = self[p1]
708 if copies: 709 if copies:
709 # Adjust copy records, the dirstate cannot do it, it 710 # Adjust copy records, the dirstate cannot do it, it
710 # requires access to parents manifests. Preserve them 711 # requires access to parents manifests. Preserve them
711 # only for entries added to first parent. 712 # only for entries added to first parent.
712 pctx = self[p1]
713 for f in copies: 713 for f in copies:
714 if f not in pctx and copies[f] in pctx: 714 if f not in pctx and copies[f] in pctx:
715 self.dirstate.copy(copies[f], f) 715 self.dirstate.copy(copies[f], f)
716 if p2 == nullid:
717 for f, s in sorted(self.dirstate.copies().items()):
718 if f not in pctx and s not in pctx:
719 self.dirstate.copy(None, f)
716 720
717 def filectx(self, path, changeid=None, fileid=None): 721 def filectx(self, path, changeid=None, fileid=None):
718 """changeid can be a changeset revision, node, or tag. 722 """changeid can be a changeset revision, node, or tag.
719 fileid can be a file revision or node.""" 723 fileid can be a file revision or node."""
720 return context.filectx(self, path, changeid, fileid) 724 return context.filectx(self, path, changeid, fileid)