##// END OF EJS Templates
subrepo: make stdin for svn a pipe for non-interactive use (issue2759)...
Augie Fackler -
r14492:f0f96509 default
parent child Browse files
Show More
@@ -528,13 +528,17 b' class svnsubrepo(abstractsubrepo):'
528
528
529 def _svncommand(self, commands, filename=''):
529 def _svncommand(self, commands, filename=''):
530 cmd = ['svn']
530 cmd = ['svn']
531 # Starting in svn 1.5 --non-interactive is a global flag
531 extrakw = {}
532 # instead of being per-command, but we need to support 1.4 so
532 if not self._ui.interactive():
533 # we have to be intelligent about what commands take
533 # Making stdin be a pipe should prevent svn from behaving
534 # --non-interactive.
534 # interactively even if we can't pass --non-interactive.
535 if (not self._ui.interactive() and
535 extrakw['stdin'] = subprocess.PIPE
536 commands[0] in ('update', 'checkout', 'commit')):
536 # Starting in svn 1.5 --non-interactive is a global flag
537 cmd.append('--non-interactive')
537 # instead of being per-command, but we need to support 1.4 so
538 # we have to be intelligent about what commands take
539 # --non-interactive.
540 if commands[0] in ('update', 'checkout', 'commit'):
541 cmd.append('--non-interactive')
538 cmd.extend(commands)
542 cmd.extend(commands)
539 if filename is not None:
543 if filename is not None:
540 path = os.path.join(self._ctx._repo.origroot, self._path, filename)
544 path = os.path.join(self._ctx._repo.origroot, self._path, filename)
@@ -544,7 +548,7 b' class svnsubrepo(abstractsubrepo):'
544 env['LC_MESSAGES'] = 'C'
548 env['LC_MESSAGES'] = 'C'
545 p = subprocess.Popen(cmd, bufsize=-1, close_fds=util.closefds,
549 p = subprocess.Popen(cmd, bufsize=-1, close_fds=util.closefds,
546 stdout=subprocess.PIPE, stderr=subprocess.PIPE,
550 stdout=subprocess.PIPE, stderr=subprocess.PIPE,
547 universal_newlines=True, env=env)
551 universal_newlines=True, env=env, **extrakw)
548 stdout, stderr = p.communicate()
552 stdout, stderr = p.communicate()
549 stderr = stderr.strip()
553 stderr = stderr.strip()
550 if p.returncode:
554 if p.returncode:
General Comments 0
You need to be logged in to leave comments. Login now