D9954: bundle2: print "error:abort" message to stderr instead of stdout
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Thu Feb 4 07:45:40 UTC 2021
martinvonz created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
It seems like the server's message is something you'd like to see even
with `--quiet`. It's clearly part of the error.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D9954
AFFECTED FILES
mercurial/exchange.py
tests/test-narrow-pull.t
tests/test-remotefilelog-clone-tree.t
tests/test-remotefilelog-clone.t
CHANGE DETAILS
diff --git a/tests/test-remotefilelog-clone.t b/tests/test-remotefilelog-clone.t
--- a/tests/test-remotefilelog-clone.t
+++ b/tests/test-remotefilelog-clone.t
@@ -85,9 +85,9 @@
$ TEMP_STDERR=full-clone-from-shallow.stderr.tmp
$ hg clone --noupdate ssh://user@dummy/shallow full 2>$TEMP_STDERR
streaming all changes
- remote: abort: Cannot clone from a shallow repo to a full repo.
[255]
$ cat $TEMP_STDERR
+ remote: abort: Cannot clone from a shallow repo to a full repo.
abort: pull failed on remote
$ rm $TEMP_STDERR
diff --git a/tests/test-remotefilelog-clone-tree.t b/tests/test-remotefilelog-clone-tree.t
--- a/tests/test-remotefilelog-clone-tree.t
+++ b/tests/test-remotefilelog-clone-tree.t
@@ -91,7 +91,6 @@
# flakiness here
$ hg clone --noupdate ssh://user@dummy/shallow full 2>/dev/null
streaming all changes
- remote: abort: Cannot clone from a shallow repo to a full repo.
[255]
# getbundle full clone
diff --git a/tests/test-narrow-pull.t b/tests/test-narrow-pull.t
--- a/tests/test-narrow-pull.t
+++ b/tests/test-narrow-pull.t
@@ -147,6 +147,7 @@
$ hg clone -q --narrow ssh://user@dummy/master narrow2 --include "f1" -r 0
$ cd narrow2
$ hg pull -q -r 1
+ remote: abort: unexpected error: unable to resolve parent while packing b'00manifest.i' 1 for changeset 0
transaction abort!
rollback completed
abort: pull failed on remote
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1135,9 +1135,9 @@
except error.BundleValueError as exc:
raise error.Abort(_(b'missing support for %s') % exc)
except bundle2.AbortFromPart as exc:
- pushop.ui.status(_(b'remote: %s\n') % exc)
+ pushop.ui.error(_(b'remote: %s\n') % exc)
if exc.hint is not None:
- pushop.ui.status(_(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'))
except error.PushkeyFailed as exc:
partid = int(exc.partid)
@@ -1832,7 +1832,7 @@
op.modes[b'bookmarks'] = b'records'
bundle2.processbundle(pullop.repo, bundle, op=op)
except bundle2.AbortFromPart as exc:
- pullop.repo.ui.status(_(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)
except error.BundleValueError as exc:
raise error.Abort(_(b'missing support for %s') % exc)
To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list