Simulate multiple SVN users on Windows machine
How can I simulate multiple SVN users on a Windows machine to learn SVN?
I am using the book Version Control following the example of Eric Sink and want to be able to do everything from page 17, 20 from one computer, preferably Windows (although I also have Linux if necessary).
EDIT . I'll add an update to my follow-up questions to this question in the comments directly below the question. I hope this prepares other readers to set things up correctly to use this book.
My 2 cents.
source to share
This all sounds too complicated. Here's a simple way to do it:
- Use
svnadmin create
to create a repository. - Go to the repo folder
conf
. You will see filespasswd
andsvnserve.conf
. - In the file
svnserve.conf
. Find the line# password-db = passwd
and delete#
in front. This was line # 27 in my repo. - Open the file
passwd
and create some logins. They show you two examples: sally and harry. Format<user> = <password>
. - Save the file and change to the parent directory of your repository.
- Run the command
svnserve -r <repoName>
. Do not close this window. Instead, open another console window to run the other commands below. - Change to a different directory and check using the protocol
svn://
. Add the parameter--username
and--password
when performing validation. This will check the repo for the user you named. - Change to another directory and do another check using the protocol
svn://
with--username
and--password
pointing to another user.
Each working directory will be the default for these two users. It is important not to use it file:///
as a protocol. Use svn://
:
C:> svn co --username harry --password harrysecret svn://localhost
By default, the commit will be done by the checking user. The first check you make will become the root of the repo. You have to add to the catalog trunk
, branches
and tags
to simulate the actual Subversion repository structure.
The protocol is file:///
used for basic testing if you don't want to start the server. It should never be used by multiple users, and you should never run a real repository with it. (The main thing is that it uses a repository for web browsers like [ViewVC] ( http://www.viewvc.org because it file:///
works very fast.) No need file:///
, because svnserve
it gets up and running quite easily. And you even can make it a Windows service .
Following the exercises in the book
I added generosity. Here is the book - ericsink.com/vcbe/vcbe_a4_lo.pdf. I want to be able to do everything on pages 17 to 20 from one computer, preferably from windows. I also have Linux if you need
The book makes some assumptions about the computer you are using (looks like a Mac) and is a little confusing as it switches from Harry to Sally and back again. We'll simplify this by using one console window when you are Sally and one when you are Harry.
You need a good Windows text editor. Don't use Notepad! ... Notepad is not a program editor. Get Notepad ++ . It is GUI oriented, simple yet powerful. It is also available as open source and free.
Below I list the differences between the directions in the book and what you do in your Windows box. I am assuming you have administrator access to your windows window.
Page 15
Create a repository on a Windows computer. We will create a repo at C: \ repos \ lottery>:
C:\> mkdir repos
C:\> cd repos
C:\repos> svnadmin create lottery
C:\repos> cd lottery\conf
C:\repos\lottery\conf> notepad++ svnserver.conf
You will find the line that sets where you install the password database. This is line # 27 in my repository. You will see #
. Remove this from the line. #
comments the line. You want the line to read password-db = passwd
. Then save the file. This tells the Subversion server process that the file passwd
will contain the users and passwords for your repository.
Now edit the file passwd
with notepad++
. You want it to look like this:
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
[users]
harry = harryssecret
sally = sallyssecret
All I did was remove the comment mark ( #
) from two users. Save the file passwd
. You have two users in your repository who are allowed to make and check out changes. Sally's password is sallysecret and Harry's password is harrysecret.
You are in the directory C:\repos\lottery\conf
. Let's run the repo:
C:\repos\lottery\conf> cd C:\>
C:\> svnserve -d --root=repos
Page 16:
On the same computer, go to the directory called C:\workdirs
. Here we will create working directories for Harry and Sally. To do this, open another console window. This console window will work for Harry:
C:\> cd \
C:\> mkdir workdirs
C:\> cd workdirs
C:\workdirs> mkdir harry
Now make Harry Checkout:
C:\workdirs> cd harry
C:\workdirs\harry> svn co --username harry --password harrysecret svn://localhost/lottery
You may be asked if you want to store passwords in the client configuration and a warning that they will be stored in plain text. Let's go ahead and talk yes
about these issues. This way, you don't have to enter your password every time.
Now go to Harry's working directory
C:\workdirs\harry> cd lottery
You are now in Harry's working directory.
Don't touch the catalog .svn
! This stores information about your working copy: who checked it out. What a repository. What version, etc.
You should be able to do everything until you get to Chapter 3 at the bottom of the page.
Now create Sally's working directory:
Open another console window. You now have three console windows:
- It is an executable
svnserve
process. Closing this window will disablesvnserve
. This can be minimized. - This is Harry's working copy.
- This will be Sally's working copy.
It's easier to keep everything in separate console windows. In fact, you can change the color scheme of the window to help you quickly find out which window you are in. Create a working copy of Sally:
C:\> cd \workdirs
C:\workdirs> mkdir sally
C:\workddirs> cd sally
C:\workdirs\sally> svn co --username sally svn://localhost/lottery
password: •••••••
Since you did not use the parameter --password
, you are asked for the Sally password. Again, if asked about storing passwords, go ahead and say yes. This way you don't need to enter the Sally password.
Finally:
C: \ workdirs \ sally> lottery cd
This is Sally's working directory.
You should be fine using Sally's window on page 19 when we get back to Harry's working copy.
From now on, if you are working with a working copy of Harry, just switch to Harry's window. If you are working as Sally, switch to Sally's window. Everything else should be fine and just follow the examples throughout.
source to share
If you want to simulate multiple users working in the same project, you can configure the Subversion + Apache HTTP Server package (VisualSVN Server, SVN Edge) and then use multiple working copies under different users to "work" on the project.
I see little or no practical or educational value in your instructions.
source to share