[PATCH STABLE] debugrevlog: improve handling of empty manifests/changelogs

Yuya Nishihara yuya at tcha.org
Sun Jan 31 01:55:58 CST 2016


On Fri, 29 Jan 2016 11:38:04 -0500, timeless wrote:
> > Why checking numerator?
> 
> If it's 0, then I'm happy saying the value is 0. If it's not zero,
> then I don't want to decide how to handle it. I.e. from my perspective
> 0/x should be treated as 0, people can understand that. 1/0 otoh
> should be Inf, and that's too hard to reason through. If we manage to
> hit that case, I'd like someone else to solve it.

I don't see much difference between 0/0=0 and x/0=0. Both are generally
undefined. Because this patch is the workaround for ZeroDivisionError, it
doesn't make sense for me to handle 0/x specially.

FYI, "gzip -l" shows "0.0%" for x/0, but in "xz -l", it is "---".

> > You can make an empty commit by "--config ui.allowemptycommit=True" or
> > "hg branch foo && hg ci".
>
> This doesn't seem to match what I was expecting at all. Apparently an
> empty commit isn't considered a revision (?!).

You're right. Empty commit doesn't make a new entry in 00manifest.i.

https://selenic.com/repo/hg/rev/301725c3df9a


More information about the Mercurial-devel mailing list