comparison mercurial/sshpeer.py @ 20794:8b0e3a8982ea

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.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 18 Mar 2014 13:40:03 -0700
parents 447332970d7b
children 167047ba3cfa
comparison
equal deleted inserted replaced
20793:60c175c1e708 20794:8b0e3a8982ea
49 49
50 if create: 50 if create:
51 cmd = '%s %s %s' % (sshcmd, args, 51 cmd = '%s %s %s' % (sshcmd, args,
52 util.shellquote("%s init %s" % 52 util.shellquote("%s init %s" %
53 (_serverquote(remotecmd), _serverquote(self.path)))) 53 (_serverquote(remotecmd), _serverquote(self.path))))
54 ui.note(_('running %s\n') % cmd) 54 ui.debug('running %s\n' % cmd)
55 res = util.system(cmd) 55 res = util.system(cmd)
56 if res != 0: 56 if res != 0:
57 self._abort(error.RepoError(_("could not create remote repo"))) 57 self._abort(error.RepoError(_("could not create remote repo")))
58 58
59 self._validaterepo(sshcmd, args, remotecmd) 59 self._validaterepo(sshcmd, args, remotecmd)
66 self.cleanup() 66 self.cleanup()
67 67
68 cmd = '%s %s %s' % (sshcmd, args, 68 cmd = '%s %s %s' % (sshcmd, args,
69 util.shellquote("%s -R %s serve --stdio" % 69 util.shellquote("%s -R %s serve --stdio" %
70 (_serverquote(remotecmd), _serverquote(self.path)))) 70 (_serverquote(remotecmd), _serverquote(self.path))))
71 self.ui.note(_('running %s\n') % cmd) 71 self.ui.debug('running %s\n' % cmd)
72 cmd = util.quotecommand(cmd) 72 cmd = util.quotecommand(cmd)
73 73
74 # while self.subprocess isn't used, having it allows the subprocess to 74 # while self.subprocess isn't used, having it allows the subprocess to
75 # to clean up correctly later 75 # to clean up correctly later
76 self.pipeo, self.pipei, self.pipee, self.subprocess = util.popen4(cmd) 76 self.pipeo, self.pipei, self.pipee, self.subprocess = util.popen4(cmd)