mercurial/localrepo.py
changeset 27167 3fe8cb40c9c5
parent 27166 263db31329a6
child 27233 dfb836a31b61
equal deleted inserted replaced
27166:263db31329a6 27167:3fe8cb40c9c5
   850         return filelog.filelog(self.svfs, f)
   850         return filelog.filelog(self.svfs, f)
   851 
   851 
   852     def changectx(self, changeid):
   852     def changectx(self, changeid):
   853         return self[changeid]
   853         return self[changeid]
   854 
   854 
   855     def parents(self, changeid=None):
       
   856         '''get list of changectxs for parents of changeid'''
       
   857         return self[changeid].parents()
       
   858 
       
   859     def setparents(self, p1, p2=nullid):
   855     def setparents(self, p1, p2=nullid):
   860         self.dirstate.beginparentchange()
   856         self.dirstate.beginparentchange()
   861         copies = self.dirstate.setparents(p1, p2)
   857         copies = self.dirstate.setparents(p1, p2)
   862         pctx = self[p1]
   858         pctx = self[p1]
   863         if copies:
   859         if copies:
  1168                 ui.warn(_('named branch could not be reset: '
  1164                 ui.warn(_('named branch could not be reset: '
  1169                           'current branch is still \'%s\'\n')
  1165                           'current branch is still \'%s\'\n')
  1170                         % self.dirstate.branch())
  1166                         % self.dirstate.branch())
  1171 
  1167 
  1172             self.dirstate.invalidate()
  1168             self.dirstate.invalidate()
  1173             parents = tuple([p.rev() for p in self.parents()])
  1169             parents = tuple([p.rev() for p in self[None].parents()])
  1174             if len(parents) > 1:
  1170             if len(parents) > 1:
  1175                 ui.status(_('working directory now based on '
  1171                 ui.status(_('working directory now based on '
  1176                             'revisions %d and %d\n') % parents)
  1172                             'revisions %d and %d\n') % parents)
  1177             else:
  1173             else:
  1178                 ui.status(_('working directory now based on '
  1174                 ui.status(_('working directory now based on '