ui: move push/pull messages to stderr

Summary:
Those messages like "pulling from ...", "added n commits ..." belong to stderr.

This makes it possible for us to turn on verbose output for auto pull, without
breaking tools that parses stdout.

Reviewed By: sfilipco

Differential Revision: D25315955

fbshipit-source-id: 933f631610840eb5f603ad817f7560c78b19e4ad
This commit is contained in:
Jun Wu 2020-12-16 20:08:44 -08:00 committed by Facebook GitHub Bot
parent aef162f7a1
commit 63bb40f9c4
27 changed files with 100 additions and 99 deletions

View File

@ -113,7 +113,7 @@ Perform ovrsource pushrebase, make sure it is push-redirected into Megarepo
$ cd "$TESTTMP/ovr-hg-cnt"
$ REPONAME=ovr-mon hgmn up -q master_bookmark
$ echo 1 > pushredirected_1 && hg addremove -q && hg ci -q -m pushredirected_1
$ REPONAME=ovr-mon hgmn push -r . --to master_bookmark | grep updating
$ REPONAME=ovr-mon hgmn push -r . --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
-- pushredirected_1 was correctly pushed to master_bookmark in ovrsource
$ log -r master_bookmark
@ -142,7 +142,7 @@ in "all" configs does not cause any undesired effects for push-rebases
$ cd "$TESTTMP/ovr-hg-cnt"
$ REPONAME=ovr-mon hgmn up -q master_bookmark
$ echo 2 > pushredirected_2 && hg addremove -q && hg ci -q -m pushredirected_2
$ REPONAME=ovr-mon hgmn push -r . --to master_bookmark | grep updating
$ REPONAME=ovr-mon hgmn push -r . --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
-- pushredirected_2 was correctly pushed to master_bookmark
$ log -r master_bookmark
@ -298,11 +298,11 @@ Do the invisible merge by gradually merging TOMERGES into master
Create special marker commits in both repos, which can be just marked as rewritten into each other
$ cd "$TESTTMP/ovr-hg-cnt"
$ hg ci -qm "pre push-redirection marker" --config ui.allowemptycommit=True
$ REPONAME=ovr-mon hgmn push -r . --to master_bookmark | grep updating
$ REPONAME=ovr-mon hgmn push -r . --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
$ cd "$TESTTMP/fbs-hg-cnt"
$ hg ci -qm "pre push-redirection marker" --config ui.allowemptycommit=True
$ REPONAME=fbs-mon hgmn push -r . --to master_bookmark | grep updating
$ REPONAME=fbs-mon hgmn push -r . --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
Set mutable counter for the backsyncer (we've synced everything up until now)
@ -335,7 +335,7 @@ Perform ovrsource pushrebase, make sure it is push-redirected into Fbsource
$ cd "$TESTTMP/ovr-hg-cnt"
$ REPONAME=ovr-mon hgmn up -q master_bookmark
$ echo 1 > pushredirected_3 && hg addremove -q && hg ci -q -m pushredirected_3
$ REPONAME=ovr-mon hgmn push -r . --to master_bookmark | grep updating
$ REPONAME=ovr-mon hgmn push -r . --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
-- pushredirected_3 was correctly pushed to master_bookmark in ovrsource
$ log -r master_bookmark

View File

@ -281,7 +281,7 @@ Merge with preserved ancestors
$ hg book -r . merge_with_preserved
-- push these folks to the server-side repo
$ REPONAME=with_merge_mon hgmn push --to with_merge_master | grep updating
$ REPONAME=with_merge_mon hgmn push --to with_merge_master 2>&1 | grep updating
updating bookmark with_merge_master
-- sync p1

View File

@ -62,7 +62,7 @@ to the small repo
Force pushrebase to the small repo with one commit succeeds, and does not get
blocked by deny_files
$ echo 2 > 2 && hg addremove -q && hg ci -q -m newcommit
$ REPONAME=small-mon hgmn push -r . --to test_bookmark --force | grep updating
$ REPONAME=small-mon hgmn push -r . --to test_bookmark --force 2>&1 | grep updating
updating bookmark test_bookmark
-- newcommit was correctly pushed to test_bookmark
$ log -r test_bookmark

View File

@ -160,7 +160,7 @@ Normal pushrebase with one commit
$ cd "$TESTTMP/small-hg-client-1"
$ REPONAME=small-mon-1 hgmn up -q master_bookmark
$ echo 2 > 2 && hg addremove -q && hg ci -q -m newcommit
$ REPONAME=small-mon-1 hgmn push -r . --to master_bookmark | grep updating
$ REPONAME=small-mon-1 hgmn push -r . --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
-- newcommit was correctly pushed to master_bookmark
$ log -r master_bookmark
@ -289,7 +289,7 @@ Again, normal pushrebase with one commit
$ mkdir -p special
$ echo f > special/f && hg ci -Aqm post_config_change_commit
$ REPONAME=small-mon-1 hgmn push -r . --to master_bookmark | grep updating
$ REPONAME=small-mon-1 hgmn push -r . --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
-- in the large repo, new commit touched an after_change path

View File

@ -44,7 +44,7 @@ blocked by deny_files
$ cd "$TESTTMP/small-hg-client"
$ REPONAME=small-mon hgmn up -q master_bookmark
$ echo 2 > 2 && hg addremove -q && hg ci -q -m newcommit
$ REPONAME=small-mon hgmn push -r . --to master_bookmark | grep updating
$ REPONAME=small-mon hgmn push -r . --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
-- newcommit was correctly pushed to master_bookmark
$ log -r master_bookmark

View File

@ -210,7 +210,7 @@ Normal pushrebase with one commit
$ cd "$TESTTMP/small-hg-client-1"
$ REPONAME=small-mon-1 hgmn up -q master_bookmark
$ echo 2 > 2 && hg addremove -q && hg ci -q -m newcommit
$ REPONAME=small-mon-1 hgmn push -r . --to master_bookmark | grep updating
$ REPONAME=small-mon-1 hgmn push -r . --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
-- newcommit was correctly pushed to master_bookmark
$ log -r master_bookmark
@ -246,7 +246,9 @@ Force pushrebase should fail, because it pushes to a shared bookmark
$ cd "$TESTTMP/small-hg-client-1"
$ REPONAME=small-mon-1 hgmn up -q master_bookmark^
$ echo 3 > 3 && hg add 3 && hg ci -q -m "non-forward move"
$ REPONAME=small-mon-1 hgmn push --to master_bookmark --force --pushvar NON_FAST_FORWARD=true | grep updating
$ REPONAME=small-mon-1 hgmn push --to master_bookmark --force --pushvar NON_FAST_FORWARD=true >/dev/null
pushing * (glob)
searching * (glob)
remote: Command failed
remote: Error:
remote: cannot force pushrebase to shared bookmark master_bookmark
@ -257,7 +259,7 @@ Force pushrebase should fail, because it pushes to a shared bookmark
remote: Debug context:
remote: "cannot force pushrebase to shared bookmark master_bookmark"
abort: stream ended unexpectedly (got 0 bytes, expected 4)
[1]
[255]
Non-shared bookmark should work
$ REPONAME=small-mon-1 hgmn push --to master_bookmark_non_fast_forward --force --create -q
@ -271,7 +273,7 @@ Non-shared bookmark should work
Bookmark-only pushrebase (Create a new bookmark, do not push commits)
$ cd "$TESTTMP/small-hg-client-1"
$ REPONAME=small-mon-1 hgmn push -r master_bookmark^ --to master_bookmark_2 --create | grep exporting
$ REPONAME=small-mon-1 hgmn push -r master_bookmark^ --to master_bookmark_2 --create 2>&1 | grep exporting
exporting bookmark master_bookmark_2
$ hg book --all
no bookmarks set
@ -292,7 +294,7 @@ Bookmark-only pushrebase (Create a new bookmark, do not push commits)
Delete a bookmark
$ cd "$TESTTMP/small-hg-client-1"
$ REPONAME=small-mon-1 hgmn push -d master_bookmark_2 | grep deleting
$ REPONAME=small-mon-1 hgmn push -d master_bookmark_2 2>&1 | grep deleting
deleting remote bookmark master_bookmark_2
$ hg book --all
no bookmarks set

View File

@ -29,7 +29,7 @@ Normal pushrebase with one commit
$ cd "$TESTTMP/small-hg-client"
$ REPONAME=small-mon hgmn up -q master_bookmark
$ echo 2 > 2 && hg addremove -q && hg ci -q -m newcommit
$ REPONAME=small-mon hgmn push -r . --to master_bookmark | grep updating
$ REPONAME=small-mon hgmn push -r . --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
-- newcommit was correctly pushed to master_bookmark
$ log -r master_bookmark
@ -53,7 +53,7 @@ Normal pushrebase with one commit
Bookmark-only pushrebase (Create a new bookmark, do not push commits)
$ cd "$TESTTMP/small-hg-client"
$ REPONAME=small-mon hgmn push -r master_bookmark^ --to master_bookmark_2 --create | grep exporting
$ REPONAME=small-mon hgmn push -r master_bookmark^ --to master_bookmark_2 --create 2>&1 | grep exporting
exporting bookmark master_bookmark_2
$ hg book --all
no bookmarks set
@ -72,7 +72,7 @@ Bookmark-only pushrebase (Create a new bookmark, do not push commits)
Delete a bookmark
$ cd "$TESTTMP/small-hg-client"
$ REPONAME=small-mon hgmn push -d master_bookmark_2 | grep deleting
$ REPONAME=small-mon hgmn push -d master_bookmark_2 2>&1 | grep deleting
deleting remote bookmark master_bookmark_2
$ hg book --all
no bookmarks set
@ -120,7 +120,7 @@ Pushrebase, which copies and removes files
$ hg mv 5 5.renamed -q
$ hg cp 6 subdir/6.copy -q
$ REPONAME=small-mon hgmn ci -m "Moves, renames and copies"
$ REPONAME=small-mon hgmn push --to master_bookmark | grep updating
$ REPONAME=small-mon hgmn push --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
$ log -r master_bookmark
@ Moves, renames and copies [public;rev=7;b888ee4f19b5] default/master_bookmark
@ -141,7 +141,7 @@ Pushrebase, which replaces a directory with a file
$ hg rm subdir
removing subdir/6.copy
$ createfile subdir && hg ci -qm "Replace a directory with a file"
$ REPONAME=small-mon hgmn push --to master_bookmark | grep updating
$ REPONAME=small-mon hgmn push --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
$ log -r master_bookmark
@ Replace a directory with a file [public;rev=8;e72ee383159a] default/master_bookmark
@ -178,7 +178,7 @@ Normal pushrebase to a prefixed bookmark
$ cd "$TESTTMP/small-hg-client"
$ REPONAME=small-mon hgmn up -q master_bookmark_2
$ echo "more epicness" >> epicfail && hg ci -m "The epicness of this fail is greater"
$ REPONAME=small-mon hgmn push --to master_bookmark_2 | grep updating
$ REPONAME=small-mon hgmn push --to master_bookmark_2 2>&1 | grep updating
updating bookmark master_bookmark_2
$ log -r master_bookmark_2
@ The epicness of this fail is greater [public;rev=10;bd5577e4b538] default/master_bookmark_2
@ -199,7 +199,7 @@ Pushrebase with a rename between a shifted and a non-shifted behavior
$ REPONAME=small-mon hgmn up -q master_bookmark
$ createfile non_path_shifting/filetomove && createfile filetonotmove
$ hg ci -qm "But since it is for you, I vow To slap Aeneas down to hell"
$ REPONAME=small-mon hgmn push --to master_bookmark | grep updating
$ REPONAME=small-mon hgmn push --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
-- let's sync it, make sure everything is fine
$ cd "$TESTTMP/large-hg-client"
@ -214,7 +214,7 @@ Pushrebase with a rename between a shifted and a non-shifted behavior
$ REPONAME=small-mon hgmn up -q master_bookmark
$ hg mv non_path_shifting/filetomove filetomove
$ hg ci -qm "I shall delay no longer now But knock him for a fare-you-well."
$ REPONAME=small-mon hgmn push --to master_bookmark | grep updating
$ REPONAME=small-mon hgmn push --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
-- let's also sync it to the large repo
$ cd "$TESTTMP/large-hg-client"
@ -232,7 +232,7 @@ Pushrebase with a rename between a shifted and a non-shifted behavior
$ REPONAME=small-mon hgmn up -q master_bookmark
$ hg mv filetomove non_path_shifting/filetomove
$ hg ci -qm "Now Dido was in such great sorrow All day she neither drank nor ate"
$ REPONAME=small-mon hgmn push --to master_bookmark | grep updating
$ REPONAME=small-mon hgmn push --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
-- let's also sync it to the large repo
$ cd "$TESTTMP/large-hg-client"
@ -251,7 +251,7 @@ Pushrebase, which replaces a file with a directory
$ hg rm subdir
$ mkdir subdir
$ createfile subdir/greatfile && hg ci -qm "Replace a file with a directory"
$ REPONAME=small-mon hgmn push --to master_bookmark | grep updating
$ REPONAME=small-mon hgmn push --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
$ log -r master_bookmark
@ Replace a file with a directory [public;rev=14;4d2fda63b03e] default/master_bookmark

View File

@ -34,7 +34,7 @@
$ cd "$TESTTMP/small-hg-client"
$ REPONAME=small-mon hgmn up -q master_bookmark
$ echo 2 > 2 && hg addremove -q && hg ci -q -m newcommit
$ REPONAME=small-mon hgmn push -r . --to master_bookmark | grep updating
$ REPONAME=small-mon hgmn push -r . --to master_bookmark 2>&1 | grep updating
updating bookmark master_bookmark
-- newcommit was correctly pushed to master_bookmark (we need to update, as it's a new commit with date rewriting)
$ REPONAME=small-mon hgmn up -q master_bookmark
@ -102,7 +102,7 @@ Check that admin-created bookmark sets and deletes in the large repo can be corr
$ backsync_large_to_small 2>&1 | grep creating
* creating bookmark BookmarkName { bookmark: "foobar" } * (glob)
$ REPOID="$REPOIDLARGE" mononoke_admin bookmarks set bookprefix/foobar $(hg log -T "{node}" -r master_bookmark~1) &>/dev/null
$ backsync_large_to_small 2>&1 | grep updating
$ backsync_large_to_small 2>&1 2>&1 | grep updating
* updating bookmark BookmarkName { bookmark: "foobar" } * (glob)
$ REPOID="$REPOIDLARGE" mononoke_admin bookmarks delete bookprefix/foobar &>/dev/null
$ backsync_large_to_small 2>&1 | grep deleting

View File

@ -139,7 +139,7 @@ def _peersetup(ui, peer):
if ann is None:
ann = not ui.plain() and ui._isatty(ui.ferr)
if ann and not ui.quiet:
ui.warn(_("connected to %s\n") % peername)
ui.write_err(_("connected to %s\n") % peername)
perftrace.tracevalue("Server", peername)

View File

@ -429,7 +429,7 @@ class GitHandler(object):
% (remote_name, ref, new_sha[0:8])
)
else:
self.ui.status(_("adding reference %s\n") % ref)
self.ui.status_err(_("adding reference %s\n") % ref)
elif new_sha != old_sha:
if self.ui.verbose:
self.ui.note(
@ -437,7 +437,7 @@ class GitHandler(object):
% (remote_name, ref, new_sha[0:8])
)
else:
self.ui.status(_("updating reference %s\n") % ref)
self.ui.status_err(_("updating reference %s\n") % ref)
else:
self.ui.debug(
"unchanged reference %s::%s => GIT:%s\n"
@ -446,7 +446,7 @@ class GitHandler(object):
self.update_remote_branches(remote_name, new_refs)
if old_refs == new_refs:
self.ui.status(_("no changes found\n"))
self.ui.status_err(_("no changes found\n"))
ret = None
elif len(new_refs) > len(old_refs):
ret = 1 + (len(new_refs) - len(old_refs))
@ -890,9 +890,9 @@ class GitHandler(object):
# import each of the commits, oldest first
total = len(commits)
if total:
self.ui.status(_("importing git objects into hg\n"))
self.ui.status_err(_("importing git objects into hg\n"))
else:
self.ui.status(_("no changes found\n"))
self.ui.status_err(_("no changes found\n"))
importcount = total
if limit is not None:
@ -1173,7 +1173,7 @@ class GitHandler(object):
change_totals = {}
def changed(refs):
self.ui.status(_("searching for changes\n"))
self.ui.status_err(_("searching for changes\n"))
old_refs.update(refs)
all_exportable = self.get_exportable()
if revs is None:
@ -1204,7 +1204,7 @@ class GitHandler(object):
self.ui.debug("list of commits:\n")
for commit in commits:
self.ui.debug("%s\n" % commit)
self.ui.status(_("adding objects\n"))
self.ui.status_err(_("adding objects\n"))
genpack = getattr(self.git.object_store, "generate_pack_data", None)
if genpack is not None:
# dulwich >= 0.19 has generate_pack_data
@ -1227,12 +1227,12 @@ class GitHandler(object):
remote_info = "\n"
for line in remote_info[:-1].split("\n"):
self.ui.status(_("remote: %s\n") % line)
self.ui.status_err(_("remote: %s\n") % line)
try:
new_refs = client.send_pack(path, changed, genpack, progress=callback)
if len(change_totals) > 0:
self.ui.status(
self.ui.status_err(
_("added %d commits with %d trees" " and %d blobs\n")
% (
change_totals.get(Commit, 0),

View File

@ -127,7 +127,7 @@ def exbookcalcupdate(orig, ui, repo, checkout):
return orig(ui, repo, checkout)
if bookmarks.isactivewdirparent(repo):
movemarkfrom = repo["."].node()
ui.status(_("updating to active bookmark %s\n") % activemark)
ui.status_err(_("updating to active bookmark %s\n") % activemark)
checkout = activemark
return (checkout, movemarkfrom)
@ -277,7 +277,7 @@ def exfindcommonheads(orig, ui, local, remote, **kwargs):
remotenodes = set(remotenodes)
# Check which remote nodes still exist on the server
ui.status(_("searching for changes\n"))
ui.status_err(_("searching for changes\n"))
batch = remote.iterbatch()
batch.heads()
batch.known(remotenodes)
@ -291,7 +291,7 @@ def exfindcommonheads(orig, ui, local, remote, **kwargs):
# which is weird. This should be very rare though, since it only happens
# if the client has remote names, but none of those names exist on the
# server (i.e. the server has been completely replaced, or stripped).
ui.status(
ui.status_err(
_(
"server has changed since last pull - falling back to the "
"default search strategy\n"
@ -826,7 +826,7 @@ def expushdiscoverybookmarks(pushop):
hint = _("use --non-forward-move flag to complete arbitrary moves")
raise error.Abort(msg, hint=hint)
if repo[old] == repo[rev]:
repo.ui.status(_("remote bookmark already points at pushed rev\n"))
repo.ui.status_err(_("remote bookmark already points at pushed rev\n"))
return
pushop.outbookmarks.append((bookmark, old, hex(rev)))
@ -1013,7 +1013,7 @@ def expushcmd(orig, ui, repo, dest=None, **opts):
# all checks pass, go for it!
node = repo.lookup(rev)
ui.status(
ui.status_err(
_("pushing rev %s to destination %s bookmark %s\n")
% (short(node), dest, opargs["to"])
)
@ -1172,7 +1172,7 @@ def displaylocalbookmarks(ui, repo, opts, fm):
hexfn = fm.hexfunc
marks = repo._bookmarks
if len(marks) == 0 and (not fm or fm.isplain()):
ui.status(_("no bookmarks set\n"))
ui.status_err(_("no bookmarks set\n"))
tracking = _readtracking(repo)
distances = readdistancecache(repo)

View File

@ -356,7 +356,7 @@ class cg1unpacker(object):
trp = weakref.proxy(tr)
# pull off the changeset group
repo.ui.status(_("adding changesets\n"))
repo.ui.status_err(_("adding changesets\n"))
clstart = len(cl)
with progress.bar(repo.ui, _("changesets"), total=expectedtotal) as prog:
self.progress = prog
@ -379,7 +379,7 @@ class cg1unpacker(object):
changesets = clend - clstart
# pull off the manifest group
repo.ui.status(_("adding manifests\n"))
repo.ui.status_err(_("adding manifests\n"))
self._unpackmanifests(repo, revmap, trp, changesets)
needfiles = {}
@ -395,14 +395,14 @@ class cg1unpacker(object):
needfiles.setdefault(f, set()).add(n)
# process the files
repo.ui.status(_("adding file changes\n"))
repo.ui.status_err(_("adding file changes\n"))
newrevs, newfiles = _addchangegroupfiles(repo, self, revmap, trp, needfiles)
revisions += newrevs
files += newfiles
htext = ""
repo.ui.status(
repo.ui.status_err(
_("added %d changesets" " with %d changes to %d files%s\n")
% (changesets, revisions, files, htext)
)
@ -1071,7 +1071,7 @@ def getunbundler(version, fh, alg, extras=None):
def _changegroupinfo(repo, nodes, source):
# type: (Any, Sequence[bytes], str) -> None
if repo.ui.verbose or source == "bundle":
repo.ui.status(_("%d changesets found\n") % len(nodes))
repo.ui.status_err(_("%d changesets found\n") % len(nodes))
if repo.ui.debugflag:
repo.ui.debug("list of changesets:\n")
for node in nodes:

View File

@ -4771,7 +4771,7 @@ def pull(ui, repo, source="default", **opts):
raise error.Abort(msg, hint=hint)
source, branches = hg.parseurl(ui.expandpath(source))
ui.status(_("pulling from %s\n") % util.hidepassword(source))
ui.status_err(_("pulling from %s\n") % util.hidepassword(source))
with repo.connectionpool.get(source, opts=opts) as conn:
with repo.wlock(), repo.lock(), repo.transaction("pull"):
@ -4985,7 +4985,7 @@ def push(ui, repo, dest=None, **opts):
)
dest = path.pushloc or path.loc
branches = (path.branch, [])
ui.status(_("pushing to %s\n") % util.hidepassword(dest))
ui.status_err(_("pushing to %s\n") % util.hidepassword(dest))
revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get("rev"))
other = hg.peer(repo, opts, dest)
@ -6148,9 +6148,8 @@ def summary(ui, repo, **opts):
if revs:
revs = [other.lookup(rev) for rev in revs]
ui.debug("comparing with %s\n" % util.hidepassword(source))
repo.ui.pushbuffer()
commoninc = discovery.findcommonincoming(repo, other, heads=revs)
repo.ui.popbuffer()
with repo.ui.configoverride({("ui", "quiet"): True}):
commoninc = discovery.findcommonincoming(repo, other, heads=revs)
return source, sbranch, other, commoninc, commoninc[1]
if needsincoming:
@ -6181,11 +6180,10 @@ def summary(ui, repo, **opts):
common = commoninc
if revs:
revs = [repo.lookup(rev) for rev in revs]
repo.ui.pushbuffer()
outgoing = discovery.findcommonoutgoing(
repo, dother, onlyheads=revs, commoninc=common
)
repo.ui.popbuffer()
with repo.ui.configoverride({("ui", "quiet"): True}):
outgoing = discovery.findcommonoutgoing(
repo, dother, onlyheads=revs, commoninc=common
)
return dest, dbranch, dother, outgoing
if needsoutgoing:

View File

@ -281,7 +281,9 @@ def strip(ui, repo, nodelist, backup=True, topic="backup"):
txnname = "strip"
if not isinstance(gen, bundle2.unbundle20):
txnname = "strip\n%s" % util.hidepassword(tmpbundleurl)
with repo.transaction(txnname) as tr:
with repo.transaction(txnname) as tr, repo.ui.configoverride(
{("ui", "quiet"): not repo.ui.verbose}
):
bundle2.applybundle(repo, gen, tr, source="strip", url=tmpbundleurl)
if not repo.ui.verbose:
repo.ui.popbuffer()

View File

@ -1797,9 +1797,8 @@ def outgoing(repo, subset, x):
if revs:
revs = [repo.lookup(rev) for rev in revs]
other = hg.peer(repo, {}, dest)
repo.ui.pushbuffer()
outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs)
repo.ui.popbuffer()
with repo.ui.configoverride({("ui", "quiet"): True}):
outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs)
cl = repo.changelog
o = {cl.rev(r) for r in outgoing.missing}
return subset & o

View File

@ -166,7 +166,7 @@ def fastdiscovery(ui, local, remote):
publicheads = set(publicheads)
# Check which remote nodes still exist on the server
ui.status(_("searching for changes\n"))
ui.status_err(_("searching for changes\n"))
batch = remote.iterbatch()
batch.heads()
batch.known(knownbookmarksvalues)
@ -175,7 +175,7 @@ def fastdiscovery(ui, local, remote):
srvheadhashes, yesnoknownbookmarks, yesnopublicheads = batch.results()
if knownbookmarksvalues and not any(yesnoknownbookmarks):
ui.status(_("No known server bookmarks\n"))
ui.status_err(_("No known server bookmarks\n"))
# Server doesn't known any remote bookmark. That's odd and it's better
# to fallback to normal discovery process. Otherwise we might request
# too many commits from the server
@ -192,7 +192,7 @@ def fastdiscovery(ui, local, remote):
# which is weird. This should be very rare though, since it only happens
# if the client has remote names, but none of those names exist on the
# server (i.e. the server has been completely replaced, or stripped).
ui.status(
ui.status_err(
_(
"server has changed since last pull - falling back to the "
"default search strategy\n"
@ -429,7 +429,7 @@ def _findcommonheadsnew(
# The local repo is empty. Everything is 'unknown'.
return [], bool(remoteheads), remoteheads
ui.status(_("searching for changes\n"))
ui.status_err(_("searching for changes\n"))
# fast paths
@ -565,7 +565,7 @@ def _findcommonheadsold(
# start actual discovery (we note this before the next "if" for
# compatibility reasons)
ui.status(_("searching for changes\n"))
ui.status_err(_("searching for changes\n"))
srvheads = dag.internalizeall(srvheadhashes, filterunknown=True)
if len(srvheads) == len(srvheadhashes):

View File

@ -59,8 +59,6 @@ Make upload to bundlestore fail
$ cd client
$ mkcommit failpushcommit
$ hg push -r . --to scratch/scratchpush 2>err
pushing to ssh://user@dummy/repo
searching for changes
[255]
$ grep '^remote: ' err
remote: infinitepush: b2x:infinitepush \(eventtype=start, hostname=.+, requestid=\d+, user=\w+\) (re)

View File

@ -221,7 +221,7 @@ Make sure commit was pulled by checking that commit is present
$ hg log -r e0230a60975b38a9014f098fb973199efd25c46f -T '{node}\n'
pulling 'e0230a60975b38a9014f098fb973199efd25c46f' from 'ssh://user@dummy/repo'
e0230a60975b38a9014f098fb973199efd25c46f
$ hg cloud restorebackup --user anotheruser --reporoot $TESTTMP/backupsource > /dev/null
$ hg cloud restorebackup --user anotheruser --reporoot $TESTTMP/backupsource > /dev/null 2>/dev/null
$ hg log -r tip -T '{node}\n'
e0230a60975b38a9014f098fb973199efd25c46f

View File

@ -84,9 +84,10 @@
rebasing f8d4b0697695 "test commit"
ran 'immrebase' in * sec (glob)
stdout: pulling from $TESTTMP/repo1
stdout: no changes found
stderr: pulling from $TESTTMP/repo1
searching for changes
no changes found
ran 'pull' in * sec (glob)

View File

@ -11,7 +11,7 @@ Load commonly used test logic
$ cd ..
$ hg init hgrepo-empty
$ hg -R hgrepo-empty incoming gitrepo | grep -v 'no changes found'
$ hg -R hgrepo-empty incoming gitrepo 2>&1 | grep -v 'no changes found'
comparing with gitrepo
commit: 7eeab2ea75ec
bookmark: master
@ -20,11 +20,11 @@ Load commonly used test logic
summary: add alpha
$ hg clone gitrepo hgrepo | grep -v '^updating'
$ hg clone gitrepo hgrepo 2>&1 | grep -v '^updating'
importing git objects into hg
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R hgrepo incoming | grep -v 'no changes found'
$ hg -R hgrepo incoming 2>&1 | grep -v 'no changes found'
comparing with $TESTTMP/gitrepo
$ cd gitrepo
@ -33,7 +33,7 @@ Load commonly used test logic
$ fn_git_commit -m 'add beta'
$ cd ..
$ hg -R hgrepo incoming | grep -v 'no changes found'
$ hg -R hgrepo incoming 2>&1 | grep -v 'no changes found'
comparing with $TESTTMP/gitrepo
commit: 9497a4ee62e1
bookmark: master
@ -55,7 +55,7 @@ Load commonly used test logic
$ git add d/gamma
$ fn_git_commit -m'add d/gamma line 2'
$ cd ../hgrepo
$ hg incoming -p | grep -v 'no changes found'
$ hg incoming -p 2>&1 | grep -v 'no changes found'
comparing with $TESTTMP/gitrepo
commit: 9497a4ee62e1
bookmark: master
@ -95,7 +95,7 @@ Load commonly used test logic
incoming -r
$ hg incoming -r master | grep -v 'no changes found'
$ hg incoming -r master 2>&1 | grep -v 'no changes found'
comparing with $TESTTMP/gitrepo
commit: 9497a4ee62e1
bookmark: master
@ -103,7 +103,7 @@ incoming -r
date: Mon Jan 01 00:00:11 2007 +0000
summary: add beta
$ hg incoming -r b1 | grep -v 'no changes found'
$ hg incoming -r b1 2>&1 | grep -v 'no changes found'
comparing with $TESTTMP/gitrepo
commit: 9865e289be73
user: test <test@example.org>
@ -116,7 +116,7 @@ incoming -r
date: Mon Jan 01 00:00:13 2007 +0000
summary: add d/gamma line 2
$ hg incoming -r t1 | grep -v 'no changes found'
$ hg incoming -r t1 2>&1 | grep -v 'no changes found'
comparing with $TESTTMP/gitrepo
commit: 9865e289be73
user: test <test@example.org>
@ -126,8 +126,8 @@ incoming -r
nothing incoming after pull
"adding remote bookmark" message was added in Mercurial 2.3
$ hg pull | grep -v "adding remote bookmark"
$ hg pull 2>&1 | grep -v "adding remote bookmark"
pulling from $TESTTMP/gitrepo
importing git objects into hg
$ hg incoming | grep -v 'no changes found'
$ hg incoming 2>&1 | grep -v 'no changes found'
comparing with $TESTTMP/gitrepo

View File

@ -19,7 +19,7 @@ Load commonly used test logic
$ cd ..
clone a tag
$ hg clone -r alpha gitrepo hgrepo-a | grep -v '^updating'
$ hg clone -r alpha gitrepo hgrepo-a 2>&1 | grep -v '^updating'
importing git objects into hg
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R hgrepo-a log --graph
@ -30,7 +30,7 @@ clone a tag
summary: add alpha
clone a branch
$ hg clone -r beta gitrepo hgrepo-b | grep -v '^updating'
$ hg clone -r beta gitrepo hgrepo-b 2>&1 | grep -v '^updating'
importing git objects into hg
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg -R hgrepo-b log --graph
@ -53,7 +53,7 @@ clone a branch
$ cd ..
$ cd hgrepo-b
$ hg debugstrip tip 2>&1 | grep -v saving | grep -v backup
$ hg debugstrip tip 2>&1 2>&1 | grep -v saving 2>&1 | grep -v backup
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg pull -r beta
pulling from $TESTTMP/gitrepo
@ -64,7 +64,7 @@ clone a branch
git commit map cleaned
pull works after 'hg git-cleanup'
"adding remote bookmark" message was added in Mercurial 2.3
$ hg pull -r beta | grep -v "adding remote bookmark"
$ hg pull -r beta 2>&1 | grep -v "adding remote bookmark"
pulling from $TESTTMP/gitrepo
importing git objects into hg
$ hg log --graph

View File

@ -41,8 +41,8 @@ pull via ssh
# dummyssh doesn't actually work with Git, but it gets far enough to prove that
# the connection succeeded and git was invoked.
$ hg -R hgrepo pull --config paths.default=git+ssh://user@dummy/gitrepo --config ui.ssh="$(dummysshcmd)"
fatal: '/gitrepo' does not appear to be a git repository
pulling from git+ssh://user@dummy/gitrepo
fatal: '/gitrepo' does not appear to be a git repository
abort: git remote error: The remote server unexpectedly closed the connection.
[255]
@ -350,16 +350,20 @@ test for ssh vulnerability
$ hg init a
$ cd a
$ hg pull 'git+ssh://-oProxyCommand=rm${IFS}nonexistent/path' 2>&1 >/dev/null
pulling from git+ssh://-oProxyCommand%3Drm%24%7BIFS%7Dnonexistent/path
abort: potentially unsafe hostname: '-oProxyCommand=rm${IFS}nonexistent'
[255]
$ hg pull 'git+ssh://-oProxyCommand=rm%20nonexistent/path' 2>&1 >/dev/null
pulling from git+ssh://-oProxyCommand%3Drm%20nonexistent/path
abort: potentially unsafe hostname: '-oProxyCommand=rm nonexistent'
[255]
$ hg pull 'git+ssh://fakehost|shellcommand/path' 2>&1 >/dev/null
pulling from git+ssh://fakehost%7Cshellcommand/path
ssh: .* fakehost%7[Cc]shellcommand.* (re)
abort: git remote error: The remote server unexpectedly closed the connection.
[255]
$ hg pull 'git+ssh://fakehost%7Cshellcommand/path' 2>&1 >/dev/null
pulling from git+ssh://fakehost%7Cshellcommand/path
ssh: .* fakehost%7[Cc]shellcommand.* (re)
abort: git remote error: The remote server unexpectedly closed the connection.
[255]

View File

@ -178,16 +178,20 @@ test for ssh vulnerability
> ssh = ssh -o ConnectTimeout=1
> EOF
$ hg push 'git+ssh://-oProxyCommand=rm${IFS}nonexistent/path' 2>&1 >/dev/null
pushing to git+ssh://-oProxyCommand%3Drm%24%7BIFS%7Dnonexistent/path
abort: potentially unsafe hostname: '-oProxyCommand=rm${IFS}nonexistent'
[255]
$ hg push 'git+ssh://-oProxyCommand=rm%20nonexistent/path' 2>&1 >/dev/null
pushing to git+ssh://-oProxyCommand%3Drm%20nonexistent/path
abort: potentially unsafe hostname: '-oProxyCommand=rm nonexistent'
[255]
$ hg push 'git+ssh://fakehost|rm%20nonexistent/path' 2>&1 >/dev/null
pushing to git+ssh://fakehost%7Crm%20nonexistent/path
ssh: .* fakehost%7[Cc]rm%20nonexistent.* (re)
abort: git remote error: The remote server unexpectedly closed the connection.
[255]
$ hg push 'git+ssh://fakehost%7Crm%20nonexistent/path' 2>&1 >/dev/null
pushing to git+ssh://fakehost%7Crm%20nonexistent/path
ssh: .* fakehost%7[Cc]rm%20nonexistent.* (re)
abort: git remote error: The remote server unexpectedly closed the connection.
[255]

View File

@ -30,7 +30,7 @@ Test that hgsql is a requirement
Ensure streaming clones to non-hgsql repos work
$ cd ..
$ hg clone --config extensions.hgsql=! --config ui.ssh="$(dummysshcmd)" --uncompressed ssh://user@dummy/master client2 | grep "streaming all changes"
$ hg clone --config extensions.hgsql=! --config ui.ssh="$(dummysshcmd)" --uncompressed ssh://user@dummy/master client2 2>&1| grep "streaming all changes"
streaming all changes
Ensure streaming clones to hgsql repos work

View File

@ -12,7 +12,7 @@
> hg ci -m $x
> done
> cd ..
> hg clone r r2 | grep -v updating
> hg clone r r2 2>&1 | grep -v updating
> cd r2
> for x in d e f ; do
> echo $x > $x
@ -35,7 +35,7 @@
show the edit commands offered by outgoing
$ cd r2
$ HGEDITOR=cat hg histedit --outgoing ../r | grep -v comparing | grep -v searching
$ HGEDITOR=cat hg histedit --outgoing ../r 2>&1 | grep -v comparing 2>&1 | grep -v searching
pick 055a42cdd887 d
pick e860deea161a e
pick 652413bf663e f
@ -60,9 +60,8 @@ show the edit commands offered by outgoing
show the error from unrelated repos
$ cd r3
$ HGEDITOR=cat hg histedit --outgoing ../r | grep -v comparing | grep -v searching
$ HGEDITOR=cat hg histedit --outgoing ../r 2>&1 | grep -v comparing 2>&1 | grep -v searching
abort: repository is unrelated
[1]
$ cd ..
show the error from unrelated repos

View File

@ -56,7 +56,7 @@
> url=file:$TESTTMP/dummy-remote/
> EOF
$ hg push -v | egrep -v '^(uncompressed| )'
$ hg push -v 2>&1 | egrep -v '^(uncompressed| )'
pushing to $TESTTMP/server
searching for changes
2 changesets found

View File

@ -46,12 +46,6 @@ start a pull...
$ sleep 1
$ hg pull ../source2 2>/dev/null
pulling from ../source2
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
$ cat pull.out
pulling from ../source1
requesting all changes