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