问题
I am doing a project on CentOS 6.2 with the distribution supplied Emacs 23.1.1 and subversion using svnserver.
I cannot find anywhere how to set the password for repository access. [There is another question here about this (SVN for Emacs: how do you set author name and save password?) but no usable answer for my circumstances.]
BACKGROUND:
Due to client delivery requirements I need to add as little extra to the installation as possible - using yum install wherever possible, finding non-yum RPMs if necessary, and manually installing as a last resort.
I'm using subversion (SVN) from the distribution with Syntevo's SmartSVN (one example of a non-distro addition). It also required me to install a newer Java.
So far I have not had to install anything else.
This is all working but it sure would be nice to be able to commit directly from my editing sessions in Emacs.
ERRORS SEEN:
When I use Ctl-x v v to commit, I get the commit message buffer.
Ctl-c Ctl-c fails with a message: Check-in failed.
Messages shows
...
Press C-c C-c when you are done editing.
Enter a change comment. Type C-c C-c when done
Checking in /home/keywords2/www/html/kw2Show.php...
vc-svn-checkin: Check-in failed
...
vc shows
Authentication realm: <svn://localhost:3690> 47300edb-8fa2-460e-889a-ad1513dbfcdf
Password for 'keywords2': Authentication realm: <svn://localhost:3690> 47300edb-8fa2-460e-889a-ad1513dbfcdf
Username: svn: Commit failed (details follow):
svn: Can't read stdin: End of file found
回答1:
I assume that Emacs is using the command line client internally, and you can also use it directly.
SVN stores the credentials - depending on the property store-auth-creds
- in $HOME/.subversion/config
. SVN will ask for the password only, if it doesn't know it already. So, invoke SVN once from the command line and enter the password. Afterwards, you can use SVN without password - from the command line as well as from Emacs.
Try it with a simple command, e.g. svn up
.
来源:https://stackoverflow.com/questions/10148886/how-can-i-set-the-svn-password-with-emacs-23-1-built-in-integration