2

I'm trying to run "git svn dcommit" command from python script and deal with password which I have to specify manually. The standard output of this command is:

Committing to http://svn/trunk ...
Authentication realm: <http://svn:80> Active Directory credentials for users. Specific name and password for remote
Password for 'username':

at this moment, I have to specify password. Okay, there are three lines I need to read from stdout.

proc = subprocess.Popen(' git svn dcommit --username="username" ', shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
out = proc.stdout.readline()
print ":"+out
out = proc.stdout.readline()
print ":"+out
out = proc.stdout.readline()
print ":"+out
proc.stdin.write('password\n')

But I get

:Committing to http://svn/trunk ...
Authentication realm: <http://svn:80> Active Directory credentials for users. Specific name and password for remote
Password for 'username':

and after this, the script is waiting for the output which is not provided by the "git svn dcommit". It reads only first line, that's it. How can I get the rest output?

Thank you.

Alex
  • 634
  • 1
  • 8
  • 29
  • I don't know ur git/svn/shell version. but git-svn output infos to stderr in my machine. – fanlix May 24 '12 at 12:16
  • Thank you for tip! It writes 1 line to stdout, 2 line to stderr and last one (Password for 'username':) I can't read neither from stdout nor stderr. git version 1.7.0.4, python script is running under SH. Any ideas? Maybe it creates another process? Does your git-svn prints both 2 and 3 lines to stderr? – Alex May 24 '12 at 12:47
  • git-svn is just a perl script between git and svn. It calls by git, and call svn for real job. If u keep using same svn account, then dcommit will not aquire username/password input. Are u so lucky? – fanlix May 24 '12 at 12:55
  • The problem is, I have to use multiply accounts therefore I have to find the way to specify password manually every time script is running. I think the problem is solved by patching this script. – Alex May 24 '12 at 12:59
  • u can add/modify svn's acc/pwd in ~/.subversion/auth ... git-svn is very helpful, but cant fully access svn. good luck. – fanlix May 24 '12 at 13:07
  • possible duplicate of [Could I use interactive proxy authentication with git-svn?](http://stackoverflow.com/questions/11446376/could-i-use-interactive-proxy-authentication-with-git-svn) – Paul Sweatte Feb 04 '14 at 01:35

0 Answers0