diff -r 4a8bfec90ae6 -r 97f2992c26f6 mercurial/streamclone.py --- a/mercurial/streamclone.py Fri Sep 21 11:44:08 2018 -0400 +++ b/mercurial/streamclone.py Fri Sep 21 11:43:46 2018 -0400 @@ -10,7 +10,6 @@ import contextlib import os import struct -import warnings from .i18n import _ from . import ( @@ -568,12 +567,13 @@ @contextlib.contextmanager def nested(*ctxs): - with warnings.catch_warnings(): - # For some reason, Python decided 'nested' was deprecated without - # replacement. They officially advertised for filtering the deprecation - # warning for people who actually need the feature. - warnings.filterwarnings("ignore",category=DeprecationWarning) - with contextlib.nested(*ctxs): + this = ctxs[0] + rest = ctxs[1:] + with this: + if rest: + with nested(*rest): + yield + else: yield def consumev2(repo, fp, filecount, filesize):