# HG changeset patch # User Paul Morelle # Date 1532086337 -7200 # Node ID f8db458651c8a1209715e3541f47fb156224ca5a # Parent 1464183343b31158ef47ae5364ab8e81ce471368 revlog: add a method to tells whether rev is stored as a snapshot For now we only have one type of snapshot: full snapshot versus nullrev. However we are looking into adding intermediate snapshot where a large diff against another snapshot is performed instead of storing a full new text. The conditional is a bit strange and is done in order to help readability of a some later changesets. diff -r 1464183343b3 -r f8db458651c8 mercurial/revlog.py --- a/mercurial/revlog.py Wed Aug 15 15:20:44 2018 +0200 +++ b/mercurial/revlog.py Fri Jul 20 13:32:17 2018 +0200 @@ -2095,6 +2095,16 @@ else: return rev - 1 + def issnapshot(self, rev): + """tells whether rev is a snapshot + """ + if rev == nullrev: + return True + deltap = self.deltaparent(rev) + if deltap == nullrev: + return True + return False + def revdiff(self, rev1, rev2): """return or calculate a delta between two revisions