Patchwork [01,of,10] revlog: split a `_revisiondata` method to file `revision` job

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 7, 2019, 9:30 p.m.
Message ID <3b49bb04851ea501f005.1565213430@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/41202/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 7, 2019, 9:30 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1565190888 -7200
#      Wed Aug 07 17:14:48 2019 +0200
# Node ID 3b49bb04851ea501f005e7a58403fee3b1c52958
# Parent  4710384df490f426ba53055537b16030dc61d957
# EXP-Topic rawdata
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 3b49bb04851e
revlog: split a `_revisiondata` method to file `revision` job

We are about to introduce more public method to access revision data (eg:
`rawdata`). revset subclass tend to recursively call `revision` which will
create all kind of issue with the coming series. To avoid them we introduce an
explicit difference between the internal call and the public all. This will be
useful for later work anyway (so the subclass issue is just moving it earlier in
the series). I am not sure if the subclass are actually doing something
sensible. However, I am certain I don't want to be rabbit holed into figuring it
out right now.
Gregory Szorc - Aug. 8, 2019, 3:33 a.m.
On Wed, Aug 7, 2019 at 2:44 PM Pierre-Yves David <
pierre-yves.david@ens-lyon.org> wrote:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@octobus.net>
> # Date 1565190888 -7200
> #      Wed Aug 07 17:14:48 2019 +0200
> # Node ID 3b49bb04851ea501f005e7a58403fee3b1c52958
> # Parent  4710384df490f426ba53055537b16030dc61d957
> # EXP-Topic rawdata
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> 3b49bb04851e
> revlog: split a `_revisiondata` method to file `revision` job
>

I'll try to look at this series on Thursday. I apologize for not getting to
it today.


>
> We are about to introduce more public method to access revision data (eg:
> `rawdata`). revset subclass tend to recursively call `revision` which will
> create all kind of issue with the coming series. To avoid them we
> introduce an
> explicit difference between the internal call and the public all. This
> will be
> useful for later work anyway (so the subclass issue is just moving it
> earlier in
> the series). I am not sure if the subclass are actually doing something
> sensible. However, I am certain I don't want to be rabbit holed into
> figuring it
> out right now.
>
> diff --git a/mercurial/revlog.py b/mercurial/revlog.py
> --- a/mercurial/revlog.py
> +++ b/mercurial/revlog.py
> @@ -1651,6 +1651,9 @@ class revlog(object):
>          treated as raw data when applying flag transforms. 'raw' should
> be set
>          to True when generating changegroups or in debug commands.
>          """
> +        return self._revisiondata(nodeorrev, _df, raw=raw)
> +
> +    def _revisiondata(self, nodeorrev, _df=None, raw=False):
>          if isinstance(nodeorrev, int):
>              rev = nodeorrev
>              node = self.node(rev)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Gregory Szorc - Aug. 10, 2019, 8:32 p.m.
On Wed, Aug 7, 2019 at 2:44 PM Pierre-Yves David <
pierre-yves.david@ens-lyon.org> wrote:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@octobus.net>
> # Date 1565190888 -7200
> #      Wed Aug 07 17:14:48 2019 +0200
> # Node ID 3b49bb04851ea501f005e7a58403fee3b1c52958
> # Parent  4710384df490f426ba53055537b16030dc61d957
> # EXP-Topic rawdata
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> 3b49bb04851e
> revlog: split a `_revisiondata` method to file `revision` job
>

Queued this series. Sorry it took me an extra few days to look at it. I
anticipate reviewing the revision flags series too, because the handling of
flags has irked me a bit from a storage interface perspective...


>
> We are about to introduce more public method to access revision data (eg:
> `rawdata`). revset subclass tend to recursively call `revision` which will
> create all kind of issue with the coming series. To avoid them we
> introduce an
> explicit difference between the internal call and the public all. This
> will be
> useful for later work anyway (so the subclass issue is just moving it
> earlier in
> the series). I am not sure if the subclass are actually doing something
> sensible. However, I am certain I don't want to be rabbit holed into
> figuring it
> out right now.
>
> diff --git a/mercurial/revlog.py b/mercurial/revlog.py
> --- a/mercurial/revlog.py
> +++ b/mercurial/revlog.py
> @@ -1651,6 +1651,9 @@ class revlog(object):
>          treated as raw data when applying flag transforms. 'raw' should
> be set
>          to True when generating changegroups or in debug commands.
>          """
> +        return self._revisiondata(nodeorrev, _df, raw=raw)
> +
> +    def _revisiondata(self, nodeorrev, _df=None, raw=False):
>          if isinstance(nodeorrev, int):
>              rev = nodeorrev
>              node = self.node(rev)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Pierre-Yves David - Aug. 11, 2019, 9:55 a.m.
On 8/10/19 10:32 PM, Gregory Szorc wrote:
> On Wed, Aug 7, 2019 at 2:44 PM Pierre-Yves David 
> <pierre-yves.david@ens-lyon.org <mailto:pierre-yves.david@ens-lyon.org>> 
> wrote:
> 
>     # HG changeset patch
>     # User Pierre-Yves David <pierre-yves.david@octobus.net
>     <mailto:pierre-yves.david@octobus.net>>
>     # Date 1565190888 -7200
>     #      Wed Aug 07 17:14:48 2019 +0200
>     # Node ID 3b49bb04851ea501f005e7a58403fee3b1c52958
>     # Parent  4710384df490f426ba53055537b16030dc61d957
>     # EXP-Topic rawdata
>     # Available At https://bitbucket.org/octobus/mercurial-devel/
>     #              hg pull
>     https://bitbucket.org/octobus/mercurial-devel/ -r 3b49bb04851e
>     revlog: split a `_revisiondata` method to file `revision` job
> 
> 
> Queued this series. Sorry it took me an extra few days to look at it. I 
> anticipate reviewing the revision flags series too, because the handling 
> of flags has irked me a bit from a storage interface perspective...

Thanks.

I've more refactoring coming for flas (after the series on the list). 
The current series focus on removing code duplication to make it simpler 
to refactor more things in the future.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1651,6 +1651,9 @@  class revlog(object):
         treated as raw data when applying flag transforms. 'raw' should be set
         to True when generating changegroups or in debug commands.
         """
+        return self._revisiondata(nodeorrev, _df, raw=raw)
+
+    def _revisiondata(self, nodeorrev, _df=None, raw=False):
         if isinstance(nodeorrev, int):
             rev = nodeorrev
             node = self.node(rev)