mercurial/revlog.py
changeset 41089 a28833d79aca
parent 41087 84491ae0b3f0
child 41118 536c83535cbd
equal deleted inserted replaced
41088:a6556b09bf83 41089:a28833d79aca
  1531             return rev - 1
  1531             return rev - 1
  1532 
  1532 
  1533     def issnapshot(self, rev):
  1533     def issnapshot(self, rev):
  1534         """tells whether rev is a snapshot
  1534         """tells whether rev is a snapshot
  1535         """
  1535         """
       
  1536         if not self._sparserevlog:
       
  1537             return self.deltaparent(rev) == nullrev
       
  1538         elif util.safehasattr(self.index, 'issnapshot'):
       
  1539             # directly assign the method to cache the testing and access
       
  1540             self.issnapshot = self.index.issnapshot
       
  1541             return self.issnapshot(rev)
  1536         if rev == nullrev:
  1542         if rev == nullrev:
  1537             return True
  1543             return True
  1538         entry = self.index[rev]
  1544         entry = self.index[rev]
  1539         base = entry[3]
  1545         base = entry[3]
  1540         if base == rev:
  1546         if base == rev:
  1541             return True
  1547             return True
  1542         elif not self._sparserevlog:
       
  1543             return False
       
  1544         if base == nullrev:
  1548         if base == nullrev:
  1545             return True
  1549             return True
  1546         p1 = entry[5]
  1550         p1 = entry[5]
  1547         p2 = entry[6]
  1551         p2 = entry[6]
  1548         if base == p1 or base == p2:
  1552         if base == p1 or base == p2: