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