Skip to content
Snippets Groups Projects
Commit 076f1ff43f0f authored by Siddharth Agarwal's avatar Siddharth Agarwal
Browse files

clone: warn when streaming was requested but couldn't be performed

This helps both users and the people who support them figure out why
a stream clone couldn't be performed.

In an upcoming patch we're going to add a way for servers to hard
abort on a full getbundle. In those cases servers might expect
clients to perform a stream clone, so it's important to communicate
why one couldn't be done.
parent 9c60d93fd3ab
No related merge requests found
...@@ -80,7 +80,10 @@ ...@@ -80,7 +80,10 @@
streamreqs = remote.capable('streamreqs') streamreqs = remote.capable('streamreqs')
# This is weird and shouldn't happen with modern servers. # This is weird and shouldn't happen with modern servers.
if not streamreqs: if not streamreqs:
pullop.repo.ui.warn(_(
'warning: stream clone requested but server has them '
'disabled\n'))
return False, None return False, None
streamreqs = set(streamreqs.split(',')) streamreqs = set(streamreqs.split(','))
# Server requires something we don't support. Bail. # Server requires something we don't support. Bail.
...@@ -83,8 +86,15 @@ ...@@ -83,8 +86,15 @@
return False, None return False, None
streamreqs = set(streamreqs.split(',')) streamreqs = set(streamreqs.split(','))
# Server requires something we don't support. Bail. # Server requires something we don't support. Bail.
if streamreqs - repo.supportedformats: missingreqs = streamreqs - repo.supportedformats
if missingreqs:
pullop.repo.ui.warn(_(
'warning: stream clone requested but client is missing '
'requirements: %s\n') % ', '.join(sorted(missingreqs)))
pullop.repo.ui.warn(
_('(see https://www.mercurial-scm.org/wiki/MissingRequirement '
'for more information)\n'))
return False, None return False, None
requirements = streamreqs requirements = streamreqs
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
try to clone via stream, should use pull instead try to clone via stream, should use pull instead
$ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2
warning: stream clone requested but server has them disabled
requesting all changes requesting all changes
adding changesets adding changesets
adding manifests adding manifests
...@@ -75,6 +76,8 @@ ...@@ -75,6 +76,8 @@
> EOF > EOF
$ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --uncompressed http://localhost:$HGPORT/ copy3 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --uncompressed http://localhost:$HGPORT/ copy3
warning: stream clone requested but client is missing requirements: generaldelta
(see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
requesting all changes requesting all changes
adding changesets adding changesets
adding manifests adding manifests
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
try to clone via stream, should use pull instead try to clone via stream, should use pull instead
$ hg clone --uncompressed http://localhost:$HGPORT1/ copy2 $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2
warning: stream clone requested but server has them disabled
requesting all changes requesting all changes
adding changesets adding changesets
adding manifests adding manifests
...@@ -66,6 +67,8 @@ ...@@ -66,6 +67,8 @@
> EOF > EOF
$ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --uncompressed http://localhost:$HGPORT/ copy3 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --uncompressed http://localhost:$HGPORT/ copy3
warning: stream clone requested but client is missing requirements: generaldelta
(see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
requesting all changes requesting all changes
adding changesets adding changesets
adding manifests adding manifests
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment