[PATCH 3 of 5 v4] revlog: pass flags to addrevision
Rémi Chaintron
remi.chaintron at gmail.com
Wed Nov 30 06:18:54 EST 2016
Looking at the code in narrowrevlog.py on bitbucket, it looks like a good
use case to use the new flag processor method to bypass checkhash. Would
you be interested in discussing this approach / what your needs are?
On Wed, 30 Nov 2016 at 05:55 Martin von Zweigbergk via Mercurial-devel <
mercurial-devel at mercurial-scm.org> wrote:
>
>
> On Nov 23, 2016 10:39, "Remi Chaintron" <remi at fb.com> wrote:
>
> # HG changeset patch
> # User Remi Chaintron <remi at fb.com>
> # Date 1479916365 0
> # Wed Nov 23 15:52:45 2016 +0000
> # Branch stable
> # Node ID da91f91e979d6bf807912e956cf2f29573ede56f
> # Parent eb24cc60a279d614b3181a84464200bbcf5f6bb4
> revlog: pass flags to addrevision
>
>
> I think narrowhg would be happy if the flags were passed all the way
> through to checkhash(). We (some Googler) will probably send a patch the
> does that later otherwise, but maybe you can squeeze it into this patch?
>
>
> Add the ability to pass known revision flags to `revlog.addrevision`. This
> allows to ensure present flags are propagated and usable by the extensions
> relying on the flagprocessor, such as `lfs`.
>
> diff --git a/mercurial/revlog.py b/mercurial/revlog.py
> --- a/mercurial/revlog.py
> +++ b/mercurial/revlog.py
> @@ -1401,7 +1401,7 @@
> self._chunkclear()
>
> def addrevision(self, text, transaction, link, p1, p2,
> cachedelta=None,
> - node=None):
> + node=None, flags=REVIDX_DEFAULT_FLAGS):
> """add a revision to the log
>
> text - the revision data to add
> @@ -1412,6 +1412,7 @@
> node - nodeid of revision; typically node is not specified, and
> it is
> computed by default as hash(text, p1, p2), however subclasses
> might
> use different hashing method (and override checkhash() in
> such case)
> + flags - the known flags to set on the revision
> """
> if link == nullrev:
> raise RevlogError(_("attempted to add linkrev -1 to %s")
> @@ -1432,7 +1433,7 @@
> ifh = self.opener(self.indexfile, "a+",
> checkambig=self._checkambig)
> try:
> return self._addrevision(node, text, transaction, link, p1,
> p2,
> - REVIDX_DEFAULT_FLAGS, cachedelta,
> ifh, dfh)
> + flags, cachedelta, ifh, dfh)
> finally:
> if dfh:
> dfh.close()
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
--
Rémi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20161130/33822b8a/attachment.html>
More information about the Mercurial-devel
mailing list