From patchwork Tue Mar 18 20:58:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC] sshpeer: only print out 'running ssh' messages in debug mode (BC) From: Siddharth Agarwal X-Patchwork-Id: 3971 Message-Id: <2e4c971548c5b45ae5f2.1395176321@dev1738.prn1.facebook.com> To: mercurial-devel@selenic.com Date: Tue, 18 Mar 2014 13:58:41 -0700 # HG changeset patch # User Siddharth Agarwal # Date 1395175203 25200 # Tue Mar 18 13:40:03 2014 -0700 # Node ID 2e4c971548c5b45ae5f28a8ec3a2cfcc35005615 # Parent b93791e0de25ac0090d66fa04f956414b572a739 sshpeer: only print out 'running ssh' messages in debug mode (BC) Previously, if another command was run with --verbose, and for whatever reason that invoked sshpeer, we'd get a 'running ssh' message from sshpeer. This extra line would interfere with that command's output and cause dumb parsers to break. For example, hg annotate can be run with --verbose to get full usernames. This, combined with the third-party remotefilelog extension which can cause ssh connections to be created, leads to an extra 'running ssh' line that breaks most parsers. This patch is (BC) because hg pull --verbose will no longer print out exactly what ssh command it is running. No tests are affected by this change. diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py --- a/mercurial/sshpeer.py +++ b/mercurial/sshpeer.py @@ -51,7 +51,7 @@ cmd = '%s %s %s' % (sshcmd, args, util.shellquote("%s init %s" % (_serverquote(remotecmd), _serverquote(self.path)))) - ui.note(_('running %s\n') % cmd) + ui.debug('running %s\n' % cmd) res = util.system(cmd) if res != 0: self._abort(error.RepoError(_("could not create remote repo"))) @@ -68,7 +68,7 @@ cmd = '%s %s %s' % (sshcmd, args, util.shellquote("%s -R %s serve --stdio" % (_serverquote(remotecmd), _serverquote(self.path)))) - self.ui.note(_('running %s\n') % cmd) + self.ui.debug('running %s\n' % cmd) cmd = util.quotecommand(cmd) # while self.subprocess isn't used, having it allows the subprocess to