changeset 14025:1052b1421a48 stable

subrepo: tell Subversion when we are non-interactive (issue2759) $ hg clone repo repo-clone -v updating to branch default resolving manifests getting .hgsub getting .hgsubstate abort: svn: OPTIONS of 'https://subversion.srv/project': Server certificate verification failed: issuer is not trusted (https://subversion.srv)
author Augie Fackler <durin42@gmail.com>
date Fri, 29 Apr 2011 03:05:48 -0500
parents 2cd1520664b8
children 30ccb7d03864 9e8a9d45945c
files mercurial/subrepo.py
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/subrepo.py	Fri Apr 29 11:04:39 2011 +0200
+++ b/mercurial/subrepo.py	Fri Apr 29 03:05:48 2011 -0500
@@ -522,7 +522,16 @@
 
     def _svncommand(self, commands, filename=''):
         path = os.path.join(self._ctx._repo.origroot, self._path, filename)
-        cmd = ['svn'] + commands + [path]
+        cmd = ['svn']
+        # Starting in svn 1.5 --non-interactive is a global flag
+        # instead of being per-command, but we need to support 1.4 so
+        # we have to be intelligent about what commands take
+        # --non-interactive.
+        if (not self._ui.interactive() and
+            commands[0] in ('update', 'checkout', 'commit')):
+            cmd.append('--non-interactive')
+        cmd.extend(commands)
+        cmd.append(path)
         env = dict(os.environ)
         # Avoid localized output, preserve current locale for everything else.
         env['LC_MESSAGES'] = 'C'