mercurial/context.py
changeset 23603 d74eb8d477d5
parent 23602 a4679a74df14
child 23616 11a160547d7f
equal deleted inserted replaced
23602:a4679a74df14 23603:d74eb8d477d5
  1631     def _manifest(self):
  1631     def _manifest(self):
  1632         """generate a manifest based on the return values of filectxfn"""
  1632         """generate a manifest based on the return values of filectxfn"""
  1633 
  1633 
  1634         # keep this simple for now; just worry about p1
  1634         # keep this simple for now; just worry about p1
  1635         pctx = self._parents[0]
  1635         pctx = self._parents[0]
  1636         pman = pctx.manifest()
       
  1637         man = pctx.manifest().copy()
  1636         man = pctx.manifest().copy()
  1638 
  1637 
  1639         for f, fnode in pman.iteritems():
  1638         for f in self._status.modified:
  1640             p1node = nullid
  1639             p1node = nullid
  1641             p2node = nullid
  1640             p2node = nullid
  1642             p = pctx[f].parents() # if file isn't in pctx, check p2?
  1641             p = pctx[f].parents() # if file isn't in pctx, check p2?
  1643             if len(p) > 0:
  1642             if len(p) > 0:
  1644                 p1node = p[0].node()
  1643                 p1node = p[0].node()
  1645                 if len(p) > 1:
  1644                 if len(p) > 1:
  1646                     p2node = p[1].node()
  1645                     p2node = p[1].node()
  1647             fctx = self[f]
  1646             man[f] = revlog.hash(self[f].data(), p1node, p2node)
  1648             if fctx is None:
       
  1649                 # removed file
       
  1650                 del man[f]
       
  1651             else:
       
  1652                 man[f] = revlog.hash(fctx.data(), p1node, p2node)
       
  1653 
  1647 
  1654         for f in self._status.added:
  1648         for f in self._status.added:
  1655             man[f] = revlog.hash(self[f].data(), nullid, nullid)
  1649             man[f] = revlog.hash(self[f].data(), nullid, nullid)
  1656 
  1650 
  1657         for f in self._status.removed:
  1651         for f in self._status.removed: