comparison mercurial/bundle2.py @ 50514:cd2a2963b982

stream-clone: upgrade the error message for bad stream request The new version if more compact and more consistent with the general Mercurial usage.
author Arseniy Alekseyev <aalekseyev@janestreet.com>
date Sun, 21 May 2023 00:00:29 +0200
parents bcf54837241d
children f2bcb56a1d39
comparison
equal deleted inserted replaced
50513:43ed1f12b00a 50514:cd2a2963b982
1879 def addpartbundlestream2(bundler, repo, **kwargs): 1879 def addpartbundlestream2(bundler, repo, **kwargs):
1880 if not kwargs.get('stream', False): 1880 if not kwargs.get('stream', False):
1881 return 1881 return
1882 1882
1883 if not streamclone.allowservergeneration(repo): 1883 if not streamclone.allowservergeneration(repo):
1884 raise error.Abort( 1884 msg = _(b'stream data requested but server does not allow this feature')
1885 _( 1885 hint = _(b'the client seems buggy')
1886 b'stream data requested but server does not allow ' 1886 raise error.Abort(msg, hint=hint)
1887 b'this feature'
1888 ),
1889 hint=_(
1890 b'well-behaved clients should not be '
1891 b'requesting stream data from servers not '
1892 b'advertising it; the client may be buggy'
1893 ),
1894 )
1895 1887
1896 # Stream clones don't compress well. And compression undermines a 1888 # Stream clones don't compress well. And compression undermines a
1897 # goal of stream clones, which is to be fast. Communicate the desire 1889 # goal of stream clones, which is to be fast. Communicate the desire
1898 # to avoid compression to consumers of the bundle. 1890 # to avoid compression to consumers of the bundle.
1899 bundler.prefercompressed = False 1891 bundler.prefercompressed = False