Patchwork [1,of,7,V4] revlog: clarify the non sparse-revlog case in `issnapshot`

login
register
mail settings
Submitter Boris Feld
Date Dec. 30, 2018, 6:43 p.m.
Message ID <88025ac40a127963ea8a.1546195428@Laptop-Boris.lan>
Download mbox | patch
Permalink /patch/37394/
State Accepted
Headers show

Comments

Boris Feld - Dec. 30, 2018, 6:43 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1546182882 -3600
#      Sun Dec 30 16:14:42 2018 +0100
# Node ID 88025ac40a127963ea8a186ae5e81f64002db39a
# Parent  88d813cd9acd56490fdac2c0b8e66c5231c63d88
# EXP-Topic sparse-revlog
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 88025ac40a12
revlog: clarify the non sparse-revlog case in `issnapshot`

If we are not using sparse-revlog, there is only one type of snapshot, the full
one.
Yuya Nishihara - Jan. 2, 2019, 2:28 a.m.
On Sun, 30 Dec 2018 19:43:48 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1546182882 -3600
> #      Sun Dec 30 16:14:42 2018 +0100
> # Node ID 88025ac40a127963ea8a186ae5e81f64002db39a
> # Parent  88d813cd9acd56490fdac2c0b8e66c5231c63d88
> # EXP-Topic sparse-revlog
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 88025ac40a12
> revlog: clarify the non sparse-revlog case in `issnapshot`

Queued the first 5 patches, thanks.

> If we are not using sparse-revlog, there is only one type of snapshot, the full
> one.
> 
> diff --git a/mercurial/revlog.py b/mercurial/revlog.py
> --- a/mercurial/revlog.py
> +++ b/mercurial/revlog.py
> @@ -1538,6 +1538,8 @@ class revlog(object):
>          deltap = self.deltaparent(rev)
>          if deltap == nullrev:
>              return True
> +        elif not self._sparserevlog:
> +            return False

I don't fully understand generaldelta vs sparse thingy, but I trust you.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1538,6 +1538,8 @@  class revlog(object):
         deltap = self.deltaparent(rev)
         if deltap == nullrev:
             return True
+        elif not self._sparserevlog:
+            return False
         p1, p2 = self.parentrevs(rev)
         if deltap in (p1, p2):
             return False