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