[PATCH 3 of 3] revlog: support reading general deltas

Martin Geisler mg at aragost.com
Thu May 5 06:18:22 CDT 2011


Sune Foldager <cryo at cyanite.org> writes:

> On Thu, May 05, 2011 at 10:59:26 +0200, Benoit Boissinot wrote:
>>On Wed, May 4, 2011 at 11:42 PM, Sune Foldager <cryo at cyanite.org> wrote:
>>> # HG changeset patch
>>> # User Sune Foldager <cryo at cyanite.org>
>>> # Date 1304544568 -7200
>>> # Node ID 7f2e8ed280a6b1c272ec080fd2ca2315a0d264e7
>>> # Parent  39f6e0127ff15c5ad82b989d387402ec83ea30d4
>>> revlog: support reading general deltas
>>>
>>> Parentdelta (per entry) takes precedence over generaldelta (per revlog).
>>>
>>> diff --git a/mercurial/revlog.py b/mercurial/revlog.py
>>> --- a/mercurial/revlog.py
>>> +++ b/mercurial/revlog.py
>>> @@ -28,10 +28,11 @@
>>>  REVLOGNG = 1
>>>  REVLOGNGINLINEDATA = (1 << 16)
>>>  REVLOGSHALLOW = (1 << 17)
>>> +REVLOG_GENERALDELTA = (1 << 18)
>>
>>Please keep the coding style consistent.
>
> If only it were to begin with... notice we have:
>
> # revlog index flags
> REVIDX_PARENTDELTA  = 1
> REVIDX_PUNCHED_FLAG = 2
> REVIDX_KNOWN_FLAGS = REVIDX_PUNCHED_FLAG | REVIDX_PARENTDELTA
>
> ..one has '_FLAG' at the end, all have _'s. And:
>
> REVLOGNGINLINEDATA = (1 << 16)
> REVLOGSHALLOW = (1 << 17)
> REVLOG_GENERALDELTA = (1 << 18)
> REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA
> REVLOG_DEFAULT_FORMAT = REVLOGNG
> REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS
> REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGSHALLOW | REVLOG_GENERALDELTA
>
> ..some have, some don't. I would prefer using _ in all of them. Thoughts?

I also prefer the _ for constants. When all letters are in upper case,
it is very difficult to read the run-together words. Wikipedia explains
that it is the lack of ascenders and descenders that is at fault:

  http://en.wikipedia.org/wiki/Ascender_%28typography%29

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/


More information about the Mercurial-devel mailing list