dear All
I have just tried to use svnmerge for the firdst time today and found it
fairly hellish because it asks for you passphrase over and over again.
However, I found this nice hack using expec
#!/usr/bin/expect --
#
# Wrap the svnmerge script, so we're only prompted for our password once.
#
# Written by Tilghman Lesher <repotools-mergetool@xxxxxxxxxxxxxxxx>
#
eval [ concat spawn /usr/bin/svnmerge.real [ lrange $argv 0 end ] ]
expect {
"Passphrase for" {
puts "ghere"
stty -echo
expect_user -re "(.*)\n"
stty echo
send "$expect_out(1,string)\r"
}
}
expect_after eof exit
while (1) {
expect {
"Passphrase for" {
send "$expect_out(1,string)\r"
}
}
}
which I modified as follows
#!/usr/bin/expect --
#
# Wrap the svnmerge script, so we're only prompted for our password once.
#
# Written by Tilghman Lesher <repotools-mergetool@xxxxxxxxxxxxxxxx>
#
set home $env(HOME)
set svn_merge_path [file join $home bin/svnmerge.py]
eval [ concat spawn $svn_merge_path [ lrange $argv 0 end ] ]
expect {
"*assphrase for" {
stty -echo
expect_user -re "(.*)\n"
stty echo
send "$expect_out(1,string)\r"
}
}
expect_after eof exit
while (1) {
expect
expect {
"*assphrase for" {
send "$expect_out(1,string)\r"
}
}
}
so
1. it now expects the real svnmerge.py to be in $HOME/bin
2. it had a capital P for passphrase which doesn't match all svn versions
3. I haven't managed to suppress all the extra printings of Enter
passphrase for key ... yest but should be able to
4, it will crash if it doesn't see a Enter passphrase at all:
expect: spawn id exp4 not open
while executing
"expect_after eof exit"
(file "/usr/jessy/garyt/bin/svnmerge" line 20)
/
regards
gary
--
-------------------------------------------------------------------
Dr Gary Thompson
Astbury Centre for Structural Molecular Biology,
University of Leeds, Astbury Building,
Leeds, LS2 9JT, West-Yorkshire, UK Tel. +44-113-3433024
email: garyt@xxxxxxxxxxxxxxx Fax +44-113-2331407
-------------------------------------------------------------------