This is part of https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/exchange.py (10 lines) | |||
M | tests/test-bookmarks-pushpull.t (6 lines) | |||
M | tests/test-bundle2-exchange.t (24 lines) | |||
M | tests/test-bundle2-remote-changegroup.t (2 lines) | |||
M | tests/test-clone-uncompressed.t (4 lines) | |||
M | tests/test-http.t (4 lines) | |||
M | tests/test-lfs-serve.t (2 lines) | |||
M | tests/test-narrow-clone-stream.t (2 lines) | |||
M | tests/test-narrow-pull.t (2 lines) | |||
M | tests/test-narrow-shallow.t (4 lines) | |||
M | tests/test-remotefilelog-clone-tree.t (2 lines) | |||
M | tests/test-remotefilelog-clone.t (2 lines) | |||
M | tests/test-ssh.t (6 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
d9d82f2de7fc | 916c1cba6ab3 | Martin von Zweigbergk | Apr 19 2021, 3:52 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
b'unbundle', | b'unbundle', | ||||
{ | { | ||||
b'bundle': stream, | b'bundle': stream, | ||||
b'heads': [b'force'], | b'heads': [b'force'], | ||||
b'url': pushop.remote.url(), | b'url': pushop.remote.url(), | ||||
}, | }, | ||||
).result() | ).result() | ||||
except error.BundleValueError as exc: | except error.BundleValueError as exc: | ||||
raise error.Abort(_(b'missing support for %s') % exc) | raise error.RemoteError(_(b'missing support for %s') % exc) | ||||
try: | try: | ||||
trgetter = None | trgetter = None | ||||
if pushback: | if pushback: | ||||
trgetter = pushop.trmanager.transaction | trgetter = pushop.trmanager.transaction | ||||
op = bundle2.processbundle(pushop.repo, reply, trgetter) | op = bundle2.processbundle(pushop.repo, reply, trgetter) | ||||
except error.BundleValueError as exc: | except error.BundleValueError as exc: | ||||
raise error.Abort(_(b'missing support for %s') % exc) | raise error.RemoteError(_(b'missing support for %s') % exc) | ||||
except bundle2.AbortFromPart as exc: | except bundle2.AbortFromPart as exc: | ||||
pushop.ui.error(_(b'remote: %s\n') % exc) | pushop.ui.error(_(b'remote: %s\n') % exc) | ||||
if exc.hint is not None: | if exc.hint is not None: | ||||
pushop.ui.error(_(b'remote: %s\n') % (b'(%s)' % exc.hint)) | pushop.ui.error(_(b'remote: %s\n') % (b'(%s)' % exc.hint)) | ||||
raise error.Abort(_(b'push failed on remote')) | raise error.RemoteError(_(b'push failed on remote')) | ||||
except error.PushkeyFailed as exc: | except error.PushkeyFailed as exc: | ||||
partid = int(exc.partid) | partid = int(exc.partid) | ||||
if partid not in pushop.pkfailcb: | if partid not in pushop.pkfailcb: | ||||
raise | raise | ||||
pushop.pkfailcb[partid](pushop, exc) | pushop.pkfailcb[partid](pushop, exc) | ||||
for rephand in replyhandlers: | for rephand in replyhandlers: | ||||
rephand(op) | rephand(op) | ||||
try: | try: | ||||
op = bundle2.bundleoperation( | op = bundle2.bundleoperation( | ||||
pullop.repo, pullop.gettransaction, source=b'pull' | pullop.repo, pullop.gettransaction, source=b'pull' | ||||
) | ) | ||||
op.modes[b'bookmarks'] = b'records' | op.modes[b'bookmarks'] = b'records' | ||||
bundle2.processbundle(pullop.repo, bundle, op=op) | bundle2.processbundle(pullop.repo, bundle, op=op) | ||||
except bundle2.AbortFromPart as exc: | except bundle2.AbortFromPart as exc: | ||||
pullop.repo.ui.error(_(b'remote: abort: %s\n') % exc) | pullop.repo.ui.error(_(b'remote: abort: %s\n') % exc) | ||||
raise error.Abort(_(b'pull failed on remote'), hint=exc.hint) | raise error.RemoteError(_(b'pull failed on remote'), hint=exc.hint) | ||||
except error.BundleValueError as exc: | except error.BundleValueError as exc: | ||||
raise error.Abort(_(b'missing support for %s') % exc) | raise error.RemoteError(_(b'missing support for %s') % exc) | ||||
if pullop.fetch: | if pullop.fetch: | ||||
pullop.cgresult = bundle2.combinechangegroupresults(op) | pullop.cgresult = bundle2.combinechangegroupresults(op) | ||||
# processing phases change | # processing phases change | ||||
for namespace, value in op.records[b'listkeys']: | for namespace, value in op.records[b'listkeys']: | ||||
if namespace == b'phases': | if namespace == b'phases': | ||||
_pullapplyphases(pullop, value) | _pullapplyphases(pullop, value) |
#if b2-binary | #if b2-binary | ||||
$ hg push -B @ ssh # bundle2+ | $ hg push -B @ ssh # bundle2+ | ||||
pushing to ssh://user@dummy/issue4455-dest | pushing to ssh://user@dummy/issue4455-dest | ||||
searching for changes | searching for changes | ||||
no changes found | no changes found | ||||
remote: prepushkey hook exited with status 1 | remote: prepushkey hook exited with status 1 | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
#endif | #endif | ||||
$ hg -R ../issue4455-dest/ bookmarks | $ hg -R ../issue4455-dest/ bookmarks | ||||
no bookmarks set | no bookmarks set | ||||
Using http | Using http | ||||
---------- | ---------- | ||||
#if b2-binary | #if b2-binary | ||||
$ hg push -B @ ssh # bundle2+ | $ hg push -B @ ssh # bundle2+ | ||||
pushing to ssh://user@dummy/issue4455-dest | pushing to ssh://user@dummy/issue4455-dest | ||||
searching for changes | searching for changes | ||||
no changes found | no changes found | ||||
remote: prepushkey hook exited with status 1 | remote: prepushkey hook exited with status 1 | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
#endif | #endif | ||||
$ hg -R ../issue4455-dest/ bookmarks | $ hg -R ../issue4455-dest/ bookmarks | ||||
no bookmarks set | no bookmarks set | ||||
$ cd .. | $ cd .. | ||||
#endif | #endif | ||||
#if b2-binary | #if b2-binary | ||||
$ hg -R client push | $ hg -R client push | ||||
pushing to ssh://user@dummy/server | pushing to ssh://user@dummy/server | ||||
searching for changes | searching for changes | ||||
no changes found | no changes found | ||||
remote: prepushkey.no-bm-move hook exited with status 1 | remote: prepushkey.no-bm-move hook exited with status 1 | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
#endif | #endif | ||||
-- test for pushing bookmarks pointing to secret changesets | -- test for pushing bookmarks pointing to secret changesets | ||||
Set up a "remote" repo | Set up a "remote" repo | ||||
$ hg init issue6159remote | $ hg init issue6159remote | ||||
$ cd issue6159remote | $ cd issue6159remote | ||||
$ echo a > a | $ echo a > a |
[255] | [255] | ||||
$ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | ||||
pushing to ssh://user@dummy/other | pushing to ssh://user@dummy/other | ||||
searching for changes | searching for changes | ||||
remote: Abandon ship! | remote: Abandon ship! | ||||
remote: (don't panic) | remote: (don't panic) | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
$ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | ||||
pushing to http://localhost:$HGPORT2/ | pushing to http://localhost:$HGPORT2/ | ||||
searching for changes | searching for changes | ||||
remote: Abandon ship! | remote: Abandon ship! | ||||
remote: (don't panic) | remote: (don't panic) | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
Doing the actual push: unknown mandatory parts | Doing the actual push: unknown mandatory parts | ||||
$ cat << EOF >> $HGRCPATH | $ cat << EOF >> $HGRCPATH | ||||
> [failpush] | > [failpush] | ||||
> reason = unknown | > reason = unknown | ||||
> EOF | > EOF | ||||
$ hg -R main push other -r e7ec4e813ba6 | $ hg -R main push other -r e7ec4e813ba6 | ||||
pushing to other | pushing to other | ||||
searching for changes | searching for changes | ||||
abort: missing support for test:unknown | abort: missing support for test:unknown | ||||
[255] | [100] | ||||
$ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6 | ||||
pushing to ssh://user@dummy/other | pushing to ssh://user@dummy/other | ||||
searching for changes | searching for changes | ||||
abort: missing support for test:unknown | abort: missing support for test:unknown | ||||
[255] | [100] | ||||
$ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | ||||
pushing to http://localhost:$HGPORT2/ | pushing to http://localhost:$HGPORT2/ | ||||
searching for changes | searching for changes | ||||
abort: missing support for test:unknown | abort: missing support for test:unknown | ||||
[255] | [100] | ||||
Doing the actual push: race | Doing the actual push: race | ||||
$ cat << EOF >> $HGRCPATH | $ cat << EOF >> $HGRCPATH | ||||
> [failpush] | > [failpush] | ||||
> reason = race | > reason = race | ||||
> EOF | > EOF | ||||
remote: adding file changes | remote: adding file changes | ||||
remote: pre-close-tip:e7ec4e813ba6 draft | remote: pre-close-tip:e7ec4e813ba6 draft | ||||
remote: You shall not pass! | remote: You shall not pass! | ||||
remote: transaction abort! | remote: transaction abort! | ||||
remote: Cleaning up the mess... | remote: Cleaning up the mess... | ||||
remote: rollback completed | remote: rollback completed | ||||
remote: pretxnclose.failpush hook exited with status 1 | remote: pretxnclose.failpush hook exited with status 1 | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
$ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | ||||
pushing to http://localhost:$HGPORT2/ | pushing to http://localhost:$HGPORT2/ | ||||
searching for changes | searching for changes | ||||
remote: adding changesets | remote: adding changesets | ||||
remote: adding manifests | remote: adding manifests | ||||
remote: adding file changes | remote: adding file changes | ||||
remote: pre-close-tip:e7ec4e813ba6 draft | remote: pre-close-tip:e7ec4e813ba6 draft | ||||
remote: You shall not pass! | remote: You shall not pass! | ||||
remote: transaction abort! | remote: transaction abort! | ||||
remote: Cleaning up the mess... | remote: Cleaning up the mess... | ||||
remote: rollback completed | remote: rollback completed | ||||
remote: pretxnclose.failpush hook exited with status 1 | remote: pretxnclose.failpush hook exited with status 1 | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
(check that no 'pending' files remain) | (check that no 'pending' files remain) | ||||
$ ls -1 other/.hg/bookmarks* | $ ls -1 other/.hg/bookmarks* | ||||
other/.hg/bookmarks | other/.hg/bookmarks | ||||
$ ls -1 other/.hg/store/phaseroots* | $ ls -1 other/.hg/store/phaseroots* | ||||
other/.hg/store/phaseroots | other/.hg/store/phaseroots | ||||
$ ls -1 other/.hg/store/00changelog.i* | $ ls -1 other/.hg/store/00changelog.i* | ||||
remote: adding manifests | remote: adding manifests | ||||
remote: adding file changes | remote: adding file changes | ||||
remote: Fail early! | remote: Fail early! | ||||
remote: transaction abort! | remote: transaction abort! | ||||
remote: Cleaning up the mess... | remote: Cleaning up the mess... | ||||
remote: rollback completed | remote: rollback completed | ||||
remote: pretxnchangegroup hook exited with status 1 | remote: pretxnchangegroup hook exited with status 1 | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
$ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | ||||
pushing to http://localhost:$HGPORT2/ | pushing to http://localhost:$HGPORT2/ | ||||
searching for changes | searching for changes | ||||
remote: adding changesets | remote: adding changesets | ||||
remote: adding manifests | remote: adding manifests | ||||
remote: adding file changes | remote: adding file changes | ||||
remote: Fail early! | remote: Fail early! | ||||
remote: transaction abort! | remote: transaction abort! | ||||
remote: Cleaning up the mess... | remote: Cleaning up the mess... | ||||
remote: rollback completed | remote: rollback completed | ||||
remote: pretxnchangegroup hook exited with status 1 | remote: pretxnchangegroup hook exited with status 1 | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
Check output capture control. | Check output capture control. | ||||
(should be still forced for http, disabled for local and ssh) | (should be still forced for http, disabled for local and ssh) | ||||
$ cat >> $HGRCPATH << EOF | $ cat >> $HGRCPATH << EOF | ||||
> [experimental] | > [experimental] | ||||
> bundle2-output-capture=False | > bundle2-output-capture=False | ||||
remote: adding manifests | remote: adding manifests | ||||
remote: adding file changes | remote: adding file changes | ||||
remote: Fail early! | remote: Fail early! | ||||
remote: transaction abort! | remote: transaction abort! | ||||
remote: Cleaning up the mess... | remote: Cleaning up the mess... | ||||
remote: rollback completed | remote: rollback completed | ||||
remote: pretxnchangegroup hook exited with status 1 | remote: pretxnchangegroup hook exited with status 1 | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
$ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6 | ||||
pushing to http://localhost:$HGPORT2/ | pushing to http://localhost:$HGPORT2/ | ||||
searching for changes | searching for changes | ||||
remote: adding changesets | remote: adding changesets | ||||
remote: adding manifests | remote: adding manifests | ||||
remote: adding file changes | remote: adding file changes | ||||
remote: Fail early! | remote: Fail early! | ||||
remote: transaction abort! | remote: transaction abort! | ||||
remote: Cleaning up the mess... | remote: Cleaning up the mess... | ||||
remote: rollback completed | remote: rollback completed | ||||
remote: pretxnchangegroup hook exited with status 1 | remote: pretxnchangegroup hook exited with status 1 | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
Check abort from mandatory pushkey | Check abort from mandatory pushkey | ||||
$ cat > mandatorypart.py << EOF | $ cat > mandatorypart.py << EOF | ||||
> from mercurial import exchange | > from mercurial import exchange | ||||
> from mercurial import pushkey | > from mercurial import pushkey | ||||
> from mercurial import node | > from mercurial import node | ||||
> from mercurial import error | > from mercurial import error | ||||
$ hg clone -q ssh://user@dummy/lazylock lazylockclient | $ hg clone -q ssh://user@dummy/lazylock lazylockclient | ||||
$ cd lazylockclient | $ cd lazylockclient | ||||
$ touch a && hg ci -Aqm a | $ touch a && hg ci -Aqm a | ||||
$ hg push | $ hg push | ||||
pushing to ssh://user@dummy/lazylock | pushing to ssh://user@dummy/lazylock | ||||
searching for changes | searching for changes | ||||
remote: Lock should not be taken | remote: Lock should not be taken | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
$ cat >> ../lazylock/.hg/hgrc <<EOF | $ cat >> ../lazylock/.hg/hgrc <<EOF | ||||
> [experimental] | > [experimental] | ||||
> bundle2lazylocking=True | > bundle2lazylocking=True | ||||
> EOF | > EOF | ||||
$ hg push | $ hg push | ||||
pushing to ssh://user@dummy/lazylock | pushing to ssh://user@dummy/lazylock | ||||
searching for changes | searching for changes |
$ cat > repo/.hg/bundle2maker << EOF | $ cat > repo/.hg/bundle2maker << EOF | ||||
> raw-remote-changegroup {'url': 'http://localhost:$HGPORT/bundle4.hg', 'size': 581, 'digests': 'foo', 'digest:foo': 'bar'} | > raw-remote-changegroup {'url': 'http://localhost:$HGPORT/bundle4.hg', 'size': 581, 'digests': 'foo', 'digest:foo': 'bar'} | ||||
> EOF | > EOF | ||||
$ hg pull -R clone ssh://user@dummy/repo | $ hg pull -R clone ssh://user@dummy/repo | ||||
pulling from ssh://user@dummy/repo | pulling from ssh://user@dummy/repo | ||||
searching for changes | searching for changes | ||||
remote: remote-changegroup | remote: remote-changegroup | ||||
abort: missing support for remote-changegroup - digest:foo | abort: missing support for remote-changegroup - digest:foo | ||||
[255] | [100] | ||||
Missing digest | Missing digest | ||||
$ cat > repo/.hg/bundle2maker << EOF | $ cat > repo/.hg/bundle2maker << EOF | ||||
> raw-remote-changegroup {'url': 'http://localhost:$HGPORT/bundle4.hg', 'size': 581, 'digests': 'sha1'} | > raw-remote-changegroup {'url': 'http://localhost:$HGPORT/bundle4.hg', 'size': 581, 'digests': 'sha1'} | ||||
> EOF | > EOF | ||||
$ hg pull -R clone ssh://user@dummy/repo | $ hg pull -R clone ssh://user@dummy/repo | ||||
pulling from ssh://user@dummy/repo | pulling from ssh://user@dummy/repo |
$ cd .. | $ cd .. | ||||
$ hg clone --stream http://localhost:$HGPORT secret-full-disabled | $ hg clone --stream http://localhost:$HGPORT secret-full-disabled | ||||
warning: stream clone requested but server has them disabled | warning: stream clone requested but server has them disabled | ||||
requesting all changes | requesting all changes | ||||
remote: abort: server has pull-based clones disabled | remote: abort: server has pull-based clones disabled | ||||
abort: pull failed on remote | abort: pull failed on remote | ||||
(remove --pull if specified or upgrade Mercurial) | (remove --pull if specified or upgrade Mercurial) | ||||
[255] | [100] | ||||
Local stream clone with secrets involved | Local stream clone with secrets involved | ||||
(This is just a test over behavior: if you have access to the repo's files, | (This is just a test over behavior: if you have access to the repo's files, | ||||
there is no security so it isn't important to prevent a clone here.) | there is no security so it isn't important to prevent a clone here.) | ||||
$ hg clone -U --stream server local-secret | $ hg clone -U --stream server local-secret | ||||
warning: stream clone requested but server has them disabled | warning: stream clone requested but server has them disabled | ||||
requesting all changes | requesting all changes | ||||
0: draft | 0: draft | ||||
$ hg debugobsolete -R with-obsolescence | $ hg debugobsolete -R with-obsolescence | ||||
50382b884f66690b7045cac93a540cba4d4c906f 0 {c17445101a72edac06facd130d14808dfbd5c7c2} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | 50382b884f66690b7045cac93a540cba4d4c906f 0 {c17445101a72edac06facd130d14808dfbd5c7c2} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | ||||
$ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution | $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution | ||||
streaming all changes | streaming all changes | ||||
remote: abort: server has obsolescence markers, but client cannot receive them via stream clone | remote: abort: server has obsolescence markers, but client cannot receive them via stream clone | ||||
abort: pull failed on remote | abort: pull failed on remote | ||||
[255] | [100] | ||||
$ killdaemons.py | $ killdaemons.py | ||||
#endif | #endif |
$ $RUNTESTDIR/killdaemons.py | $ $RUNTESTDIR/killdaemons.py | ||||
$ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py | $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py | ||||
$ cat hg3.pid >> $DAEMON_PIDS | $ cat hg3.pid >> $DAEMON_PIDS | ||||
$ hg clone http://localhost:$HGPORT/ abort-clone | $ hg clone http://localhost:$HGPORT/ abort-clone | ||||
requesting all changes | requesting all changes | ||||
remote: abort: this is an exercise | remote: abort: this is an exercise | ||||
abort: pull failed on remote | abort: pull failed on remote | ||||
[255] | [100] | ||||
$ cat error.log | $ cat error.log | ||||
disable pull-based clones | disable pull-based clones | ||||
$ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True | $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True | ||||
$ cat hg4.pid >> $DAEMON_PIDS | $ cat hg4.pid >> $DAEMON_PIDS | ||||
$ hg clone http://localhost:$HGPORT1/ disable-pull-clone | $ hg clone http://localhost:$HGPORT1/ disable-pull-clone | ||||
requesting all changes | requesting all changes | ||||
remote: abort: server has pull-based clones disabled | remote: abort: server has pull-based clones disabled | ||||
abort: pull failed on remote | abort: pull failed on remote | ||||
(remove --pull if specified or upgrade Mercurial) | (remove --pull if specified or upgrade Mercurial) | ||||
[255] | [100] | ||||
#if no-reposimplestore | #if no-reposimplestore | ||||
... but keep stream clones working | ... but keep stream clones working | ||||
$ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone | $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone | ||||
streaming all changes | streaming all changes | ||||
* files to transfer, * of data (glob) | * files to transfer, * of data (glob) | ||||
transferred * in * seconds (*/sec) (glob) | transferred * in * seconds (*/sec) (glob) |
TODO: fail more gracefully. | TODO: fail more gracefully. | ||||
$ hg init $TESTTMP/client4_pull | $ hg init $TESTTMP/client4_pull | ||||
$ hg -R $TESTTMP/client4_pull pull http://localhost:$HGPORT | $ hg -R $TESTTMP/client4_pull pull http://localhost:$HGPORT | ||||
pulling from http://localhost:$HGPORT/ | pulling from http://localhost:$HGPORT/ | ||||
requesting all changes | requesting all changes | ||||
remote: abort: no common changegroup version | remote: abort: no common changegroup version | ||||
abort: pull failed on remote | abort: pull failed on remote | ||||
[255] | [100] | ||||
$ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES | $ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES | ||||
$TESTTMP/server/.hg/requires:lfs | $TESTTMP/server/.hg/requires:lfs | ||||
$ hg identify http://localhost:$HGPORT | $ hg identify http://localhost:$HGPORT | ||||
03b080fa9d93 | 03b080fa9d93 | ||||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||||
Case #5: client with non-lfs content and the extension enabled; server with | Case #5: client with non-lfs content and the extension enabled; server with |
$ cd ../../.. | $ cd ../../.. | ||||
Trying to stream clone when the server does not support it | Trying to stream clone when the server does not support it | ||||
$ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream | $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream | ||||
streaming all changes | streaming all changes | ||||
remote: abort: server does not support narrow stream clones | remote: abort: server does not support narrow stream clones | ||||
abort: pull failed on remote | abort: pull failed on remote | ||||
[255] | [100] | ||||
Enable stream clone on the server | Enable stream clone on the server | ||||
$ echo "[experimental]" >> master/.hg/hgrc | $ echo "[experimental]" >> master/.hg/hgrc | ||||
$ echo "server.stream-narrow-clones=True" >> master/.hg/hgrc | $ echo "server.stream-narrow-clones=True" >> master/.hg/hgrc | ||||
Cloning a specific file when stream clone is supported | Cloning a specific file when stream clone is supported | ||||
$ cd .. | $ cd .. | ||||
$ hg clone -q --narrow ssh://user@dummy/master narrow2 --include "f1" -r 0 | $ hg clone -q --narrow ssh://user@dummy/master narrow2 --include "f1" -r 0 | ||||
$ cd narrow2 | $ cd narrow2 | ||||
$ hg pull -q -r 1 | $ hg pull -q -r 1 | ||||
remote: abort: unexpected error: unable to resolve parent while packing '00manifest.i' 1 for changeset 0 | remote: abort: unexpected error: unable to resolve parent while packing '00manifest.i' 1 for changeset 0 | ||||
transaction abort! | transaction abort! | ||||
rollback completed | rollback completed | ||||
abort: pull failed on remote | abort: pull failed on remote | ||||
[255] | [100] |
$ cd .. | $ cd .. | ||||
cannot clone with zero or negative depth | cannot clone with zero or negative depth | ||||
$ hg clone --narrow ssh://user@dummy/master bad --include "d2" --depth 0 | $ hg clone --narrow ssh://user@dummy/master bad --include "d2" --depth 0 | ||||
requesting all changes | requesting all changes | ||||
remote: abort: depth must be positive, got 0 | remote: abort: depth must be positive, got 0 | ||||
abort: pull failed on remote | abort: pull failed on remote | ||||
[255] | [100] | ||||
$ hg clone --narrow ssh://user@dummy/master bad --include "d2" --depth -1 | $ hg clone --narrow ssh://user@dummy/master bad --include "d2" --depth -1 | ||||
requesting all changes | requesting all changes | ||||
remote: abort: depth must be positive, got -1 | remote: abort: depth must be positive, got -1 | ||||
abort: pull failed on remote | abort: pull failed on remote | ||||
[255] | [100] |
$ cd .. | $ cd .. | ||||
# full clone from shallow | # full clone from shallow | ||||
# - send stderr to /dev/null because the order of stdout/err causes | # - send stderr to /dev/null because the order of stdout/err causes | ||||
# flakiness here | # flakiness here | ||||
$ hg clone --noupdate ssh://user@dummy/shallow full 2>/dev/null | $ hg clone --noupdate ssh://user@dummy/shallow full 2>/dev/null | ||||
streaming all changes | streaming all changes | ||||
[255] | [100] | ||||
# getbundle full clone | # getbundle full clone | ||||
$ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc | $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc | ||||
$ hgcloneshallow ssh://user@dummy/master shallow3 | $ hgcloneshallow ssh://user@dummy/master shallow3 | ||||
requesting all changes | requesting all changes | ||||
adding changesets | adding changesets | ||||
adding manifests | adding manifests |
Note: the output to STDERR comes from a different process to the output on | Note: the output to STDERR comes from a different process to the output on | ||||
STDOUT and their relative ordering is not deterministic. As a result, the test | STDOUT and their relative ordering is not deterministic. As a result, the test | ||||
was failing sporadically. To avoid this, we capture STDERR to a file and | was failing sporadically. To avoid this, we capture STDERR to a file and | ||||
check its contents separately. | check its contents separately. | ||||
$ TEMP_STDERR=full-clone-from-shallow.stderr.tmp | $ TEMP_STDERR=full-clone-from-shallow.stderr.tmp | ||||
$ hg clone --noupdate ssh://user@dummy/shallow full 2>$TEMP_STDERR | $ hg clone --noupdate ssh://user@dummy/shallow full 2>$TEMP_STDERR | ||||
streaming all changes | streaming all changes | ||||
[255] | [100] | ||||
$ cat $TEMP_STDERR | $ cat $TEMP_STDERR | ||||
remote: abort: Cannot clone from a shallow repo to a full repo. | remote: abort: Cannot clone from a shallow repo to a full repo. | ||||
abort: pull failed on remote | abort: pull failed on remote | ||||
$ rm $TEMP_STDERR | $ rm $TEMP_STDERR | ||||
# getbundle full clone | # getbundle full clone | ||||
$ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc | $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc |
$ echo "baz" > bar | $ echo "baz" > bar | ||||
$ hg ci -A -m "unpushable commit" bar | $ hg ci -A -m "unpushable commit" bar | ||||
$ hg push --ssh "sh ../ssh.sh" | $ hg push --ssh "sh ../ssh.sh" | ||||
pushing to ssh://user@dummy/*/remote (glob) | pushing to ssh://user@dummy/*/remote (glob) | ||||
searching for changes | searching for changes | ||||
remote: Permission denied | remote: Permission denied | ||||
remote: pretxnopen.hg-ssh hook failed | remote: pretxnopen.hg-ssh hook failed | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
$ cd $TESTTMP | $ cd $TESTTMP | ||||
stderr from remote commands should be printed before stdout from local code (issue4336) | stderr from remote commands should be printed before stdout from local code (issue4336) | ||||
$ hg clone remote stderr-ordering | $ hg clone remote stderr-ordering | ||||
updating to branch default | updating to branch default | ||||
3 files updated, 0 files merged, 0 files removed, 0 files unresolved | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
remote: adding changesets | remote: adding changesets | ||||
remote: adding manifests | remote: adding manifests | ||||
remote: adding file changes | remote: adding file changes | ||||
remote: hook failure! | remote: hook failure! | ||||
remote: transaction abort! | remote: transaction abort! | ||||
remote: rollback completed | remote: rollback completed | ||||
remote: pretxnchangegroup.fail hook failed | remote: pretxnchangegroup.fail hook failed | ||||
abort: push failed on remote | abort: push failed on remote | ||||
[255] | [100] | ||||
abort during pull is properly reported as such | abort during pull is properly reported as such | ||||
$ echo morefoo >> ../remote/foo | $ echo morefoo >> ../remote/foo | ||||
$ hg -R ../remote commit --message "more foo to be pulled" | $ hg -R ../remote commit --message "more foo to be pulled" | ||||
$ cat >> ../remote/.hg/hgrc << EOF | $ cat >> ../remote/.hg/hgrc << EOF | ||||
> [extensions] | > [extensions] | ||||
> crash = ${TESTDIR}/crashgetbundler.py | > crash = ${TESTDIR}/crashgetbundler.py | ||||
> EOF | > EOF | ||||
$ hg --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" pull | $ hg --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" pull | ||||
pulling from ssh://user@dummy/remote | pulling from ssh://user@dummy/remote | ||||
searching for changes | searching for changes | ||||
remote: abort: this is an exercise | remote: abort: this is an exercise | ||||
abort: pull failed on remote | abort: pull failed on remote | ||||
[255] | [100] | ||||
abort with no error hint when there is a ssh problem when pulling | abort with no error hint when there is a ssh problem when pulling | ||||
$ hg pull ssh://brokenrepository -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" | $ hg pull ssh://brokenrepository -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" | ||||
pulling from ssh://brokenrepository/ | pulling from ssh://brokenrepository/ | ||||
abort: no suitable response from remote hg | abort: no suitable response from remote hg | ||||
[255] | [255] | ||||