[PATCH remotefilelog-ext v2] fileserverclient: avoid ever requesting nullid nodes
Durham Goode
durham at fb.com
Tue Oct 25 15:30:39 EDT 2016
Pushed (with minor fix up since ‘node’ is no longer imported in that file). Thanks!
On 10/24/16, 5:35 PM, "Augie Fackler" <raf at durin42.com> wrote:
># HG changeset patch
># User Augie Fackler <augie at google.com>
># Date 1477347305 14400
># Mon Oct 24 18:15:05 2016 -0400
># Node ID 2dbede85d40dec875be2df0442aa74982e56995d
># Parent be571104d9f7292cd218dbb1aaebda9ac0b6315f
>fileserverclient: avoid ever requesting nullid nodes
>
>I keep tripping over bugs where this angers some part of our
>stack. It's dumb to even be fetching these, but it's harmless to skip
>them, so issue a developer warning when we encounter one and refuse to
>fetch it.
>
>diff --git a/remotefilelog/fileserverclient.py b/remotefilelog/fileserverclient.py
>--- a/remotefilelog/fileserverclient.py
>+++ b/remotefilelog/fileserverclient.py
>@@ -577,6 +577,15 @@ class fileserverclient(object):
> if fetchhistory:
> missingids.update(historystore.getmissing(idstocheck))
>
>+ # partition missing nodes into nullid and not-nullid so we can
>+ # warn about this filtering potentially shadowing bugs.
>+ nullids = len([None for unused, id in missingids if id == node.nullid])
>+ if nullids:
>+ missingids = [(f, id) for f, id in missingids if id != node.nullid]
>+ repo.ui.develwarn(
>+ ('remotefilelog not fetching %d null revs'
>+ ' - this is likely hiding bugs' % nullids),
>+ config='remotefilelog-ext')
> if missingids:
> global fetches, fetched, fetchcost
> fetches += 1
More information about the Mercurial-devel
mailing list