Show More
@@ -33,9 +33,10 b' from . import (' | |||||
33 | urlerr = util.urlerr |
|
33 | urlerr = util.urlerr | |
34 | urlreq = util.urlreq |
|
34 | urlreq = util.urlreq | |
35 |
|
35 | |||
36 | bundle2required = _( |
|
36 | bundle2requiredmain = _('incompatible Mercurial client; bundle2 required') | |
37 | 'incompatible Mercurial client; bundle2 required\n' |
|
37 | bundle2requiredhint = _('see https://www.mercurial-scm.org/wiki/' | |
38 | '(see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n') |
|
38 | 'IncompatibleClient') | |
|
39 | bundle2required = '%s\n(%s)\n' % (bundle2requiredmain, bundle2requiredhint) | |||
39 |
|
40 | |||
40 | class abstractserverproto(object): |
|
41 | class abstractserverproto(object): | |
41 | """abstract class that summarizes the protocol API |
|
42 | """abstract class that summarizes the protocol API | |
@@ -948,7 +949,14 b' def unbundle(repo, proto, heads):' | |||||
948 | gen = exchange.readbundle(repo.ui, fp, None) |
|
949 | gen = exchange.readbundle(repo.ui, fp, None) | |
949 | if (isinstance(gen, changegroupmod.cg1unpacker) |
|
950 | if (isinstance(gen, changegroupmod.cg1unpacker) | |
950 | and not bundle1allowed(repo, 'push')): |
|
951 | and not bundle1allowed(repo, 'push')): | |
|
952 | if proto.name == 'http': | |||
|
953 | # need to special case http because stderr do not get to | |||
|
954 | # the http client on failed push so we need to abuse some | |||
|
955 | # other error type to make sure the message get to the | |||
|
956 | # user. | |||
951 | return ooberror(bundle2required) |
|
957 | return ooberror(bundle2required) | |
|
958 | raise error.Abort(bundle2requiredmain, | |||
|
959 | hint=bundle2requiredhint) | |||
952 |
|
960 | |||
953 | r = exchange.unbundle(repo, gen, their_heads, 'serve', |
|
961 | r = exchange.unbundle(repo, gen, their_heads, 'serve', | |
954 | proto._client()) |
|
962 | proto._client()) |
@@ -1107,6 +1107,14 b' Verify bundle1 pushes can be disabled' | |||||
1107 | (see https://www.mercurial-scm.org/wiki/IncompatibleClient) |
|
1107 | (see https://www.mercurial-scm.org/wiki/IncompatibleClient) | |
1108 | [255] |
|
1108 | [255] | |
1109 |
|
1109 | |||
|
1110 | (also check with ssh) | |||
|
1111 | ||||
|
1112 | $ hg --config devel.legacy.exchange=bundle1 push ssh://user@dummy/bundle2onlyserver | |||
|
1113 | pushing to ssh://user@dummy/bundle2onlyserver | |||
|
1114 | searching for changes | |||
|
1115 | remote: abort: incompatible Mercurial client; bundle2 required | |||
|
1116 | [1] | |||
|
1117 | ||||
1110 | $ hg push |
|
1118 | $ hg push | |
1111 | pushing to http://localhost:$HGPORT/ |
|
1119 | pushing to http://localhost:$HGPORT/ | |
1112 | searching for changes |
|
1120 | searching for changes |
General Comments 0
You need to be logged in to leave comments.
Login now