git_svn_server.git
19 months agoAdd support for the pseudo directories to check-path master
Julian Phillips [Mon, 27 Sep 2010 23:23:14 +0000 (00:23 +0100)] 
Add support for the pseudo directories to check-path

We need check-path to support the pseudo directories - so that when
the client asks what kind of thing is /tags it gets the response "a
directory", etc.  Otherwise some client commands may walk themselves
up and out of the directory because they never find a valid path to
stop on.

19 months agocheck-path doesn't always include a revision
Julian Phillips [Mon, 27 Sep 2010 23:22:25 +0000 (00:22 +0100)] 
check-path doesn't always include a revision

Sometimes the revision in check-path is omitted - treat this as
"lastest revision".

19 months agoImprove error detection in complete_commit
Julian Phillips [Mon, 27 Sep 2010 22:08:40 +0000 (23:08 +0100)] 
Improve error detection in complete_commit

More work on picking out and reporting errors in complete_commit.
There is still more to do - there are mny things that the user can try
to do, and only a few that will actually work.  The compliated part is
putting together appropriate error messages.

19 months agoStart tightening up checking in complete_commit
Julian Phillips [Mon, 27 Sep 2010 07:48:35 +0000 (08:48 +0100)] 
Start tightening up checking in complete_commit

Since Subversion is so free about it's namespace and we are only
implementing a sub-set of it, with particular rules about what changes
may be made where (e.g. no changes to tags) start using the new
HookFailure error to report restrictions back to the user.

19 months agoDon't call rev-parse unless we have a valid ref
Julian Phillips [Mon, 27 Sep 2010 07:46:45 +0000 (08:46 +0100)] 
Don't call rev-parse unless we have a valid ref

If we don't have a valid ref, then set parent to None instead of call
rev-parse with a ref of None (which causes us to end up with a parent
of 'None' as we don't currently check rev-parse for errors).

19 months agoUse pseudo pre-commit hook to prevent tag commits
Julian Phillips [Sun, 26 Sep 2010 21:16:32 +0000 (22:16 +0100)] 
Use pseudo pre-commit hook to prevent tag commits

Since we now have a pre-commit hook framework that allows the repos
instance to abort a commit with a message that will be presented to
the user, we can use it to stop commits to tags from being accepted
(since git can't actually allow you to make arbitrary changes to
tags).

19 months agoAdd support for pre-commit hook
Julian Phillips [Sun, 26 Sep 2010 21:15:41 +0000 (22:15 +0100)] 
Add support for pre-commit hook

Add the mechanism for the repos instance to report a pre-commit hook
failure that will then be passed back to the client.

19 months agoFix commit commands so that error syntax is correct
Julian Phillips [Sun, 26 Sep 2010 21:09:42 +0000 (22:09 +0100)] 
Fix commit commands so that error syntax is correct

The commit command wasn't sending the correct sequence of messages for
errors, as cmd_base was always sending a success response before
commit got a chance to send a failure.  Restructure things so that
failures can be sent correctly.

19 months agoos.popen3 is deprecated too ...
Julian Phillips [Wed, 22 Sep 2010 18:14:47 +0000 (19:14 +0100)] 
os.popen3 is deprecated too ...

19 months agomd5 is deprecated
Julian Phillips [Wed, 22 Sep 2010 18:02:36 +0000 (19:02 +0100)] 
md5 is deprecated

20 months agoSwitch update command to use DeltaCmd
Julian Phillips [Thu, 9 Sep 2010 20:01:32 +0000 (21:01 +0100)] 
Switch update command to use DeltaCmd

update is another command that is basically the same as switch, so we
can again use the DeltaCmd base class to do most of the work.

20 months agoAdd a diff command
Julian Phillips [Thu, 9 Sep 2010 19:57:53 +0000 (20:57 +0100)] 
Add a diff command

Since diff is very similar to switch, we can use the new DeltaCmd base
class to do the bulk of the work for the diff command.

20 months agoFix _path_changed
Julian Phillips [Thu, 9 Sep 2010 16:33:30 +0000 (17:33 +0100)] 
Fix _path_changed

Without -r diff-tree will only tell us about changes in the top level
- which means that we send updates for all files in a subdirectory
tree when anything in that tree has changed.  With -r it only lists
the actual paths have changed.

20 months agoPull out the switch command processing into a base class
Julian Phillips [Thu, 9 Sep 2010 09:06:49 +0000 (10:06 +0100)] 
Pull out the switch command processing into a base class

This is the first step in sharing code between switch and update.  The
bulk of the processing for the switch command is now in the DeltaCmd
class.

20 months agoCombine multiple entries for one path into a single entry
Julian Phillips [Thu, 9 Sep 2010 06:56:00 +0000 (07:56 +0100)] 
Combine multiple entries for one path into a single entry

Since we store information about a single Subversion path in multiple
git paths we need to combine those multiple entries back into a single
path when presenting log information back to Subversion.

20 months agoAdd a comment explaining why we always create .gitignore
Julian Phillips [Thu, 9 Sep 2010 03:32:56 +0000 (04:32 +0100)] 
Add a comment explaining why we always create .gitignore

Since we have a good reason to always create a .gitignore file, even
if it is empty it's worth adding a comment explaining why.

20 months agoProperty changes can only ever be 'M'
Julian Phillips [Thu, 9 Sep 2010 03:29:01 +0000 (04:29 +0100)] 
Property changes can only ever be 'M'

When a property file is added or deleted that is still just an 'M'
operation on the underlying file as far as Subversion is concerned.

20 months agoTidy up the new log code a bit
Julian Phillips [Wed, 8 Sep 2010 20:42:37 +0000 (21:42 +0100)] 
Tidy up the new log code a bit

This is functionally the same, and about the same size - but it feels
nicer somehow ...

20 months agoRework log to start including property changes
Julian Phillips [Wed, 8 Sep 2010 20:29:23 +0000 (21:29 +0100)] 
Rework log to start including property changes

The log command was no doing any mapping of git paths back to
Subversion ones, so property changes were shown as changes to files
that the Subversion client can't actually see ...

At the moment the changes aren't quite right, as if a file has both
content and property changes in the same commit they will be reported
separately instead of together.

20 months agoRemove some old debug from update
Julian Phillips [Tue, 7 Sep 2010 23:08:20 +0000 (00:08 +0100)] 
Remove some old debug from update

The list of chunks for large files is just getting in the way these
days ...

20 months agoStart adding general support for properties
Julian Phillips [Tue, 7 Sep 2010 23:05:56 +0000 (00:05 +0100)] 
Start adding general support for properties

Now we store all the properties that we can't map to git internals in
a JSON dumpfile for each file that has any such properties.  This
means that they are included in commits and visible to git users
(though there are issues with moving files etc. when peopl are not
aware of the property files).

20 months agoAdd support for changing svn:ignore
Julian Phillips [Tue, 7 Sep 2010 23:01:04 +0000 (00:01 +0100)] 
Add support for changing svn:ignore

Although there was support for setting properties on files (though
they are mostly discarded at present), there was no support support
for setting properties on files - in particular the svn:ignore
property (i.e. the .gitignore file).

20 months agoAdd support for using GitFile locally
Julian Phillips [Tue, 7 Sep 2010 23:02:57 +0000 (00:02 +0100)] 
Add support for using GitFile locally

Instead of assuming that we have a commit object to give to the
GitFile tweak it so that we can use it directly by giving it a
location instead.  This allows it to be used more generally as a
wrapper for creating files in git and getting the resulting sha1.

20 months agoThe paths in a commit aren't always relative to the top
Julian Phillips [Tue, 7 Sep 2010 21:41:03 +0000 (22:41 +0100)] 
The paths in a commit aren't always relative to the top

The paths in the files member of a GitCommit are relative to the
prefix member not to the top of the tree - we need to combine them
with the prefix before trying to use them to create a commit.

20 months agoCreate diffs in get-file-revs
Julian Phillips [Mon, 6 Sep 2010 07:43:11 +0000 (08:43 +0100)] 
Create diffs in get-file-revs

Use the previous revision that we already have to create svndiffs
rather than sending the full contents of the file for every revision.

20 months agoGenereate independant file contents for use with svndiff
Julian Phillips [Mon, 6 Sep 2010 07:39:06 +0000 (08:39 +0100)] 
Genereate independant file contents for use with svndiff

When we pass file contents objects to the svndiff Encoder it is going
to step through both files in chunks in parallel, which means that the
two file contents objects need to be independant - they can't have any
implicit sequential requirement, which GitObjects do as they all read
from the same cat-file instance.  We now have an IndepGitObject that
has its own cat-file instance so that it can be read in parallel with
a GitObject or anther IndepGitObject, and a way to ask for an
independant contents object - which we then use to ask for previous
contents when we a going to create a diff.

20 months agoRemove some unwanted debug output
Julian Phillips [Mon, 6 Sep 2010 07:14:30 +0000 (08:14 +0100)] 
Remove some unwanted debug output

20 months agoUse random index file name to create commit
Julian Phillips [Mon, 6 Sep 2010 07:12:39 +0000 (08:12 +0100)] 
Use random index file name to create commit

Since we don't want two simultaneous connections to try and use the
same index file when trying to create commits, randomise the name of
the index file that we use - and also try to delete it after we have
used it to stop a large collection of used index files building up.

20 months agoDon't tell client to delete deleted paths
Julian Phillips [Sat, 4 Sep 2010 23:04:15 +0000 (00:04 +0100)] 
Don't tell client to delete deleted paths

If the client tells us that a path has been deleted, then we shouldn't
turn around and tell it to delete that same path ... that'll just
confuse the user.

20 months agoAdd support for deleting things.
Julian Phillips [Sat, 4 Sep 2010 22:51:10 +0000 (23:51 +0100)] 
Add support for deleting things.

Finally got around to adding support for deleting things.

This doesn't seem to work quite right yet, update reports the file as
being deleted - which it shouldn't ...

20 months agoOnce again the protocol document is wrong
Julian Phillips [Sat, 4 Sep 2010 22:49:56 +0000 (23:49 +0100)] 
Once again the protocol document is wrong

It turns out that the rev in the editor command is sent inside a list,
despite what the protcol document says ... ho hum, what a surprise ...

20 months agoDon't assume that changes are always to file contents
Julian Phillips [Sat, 4 Sep 2010 22:31:23 +0000 (23:31 +0100)] 
Don't assume that changes are always to file contents

If an svn user changes a file's properties then there will be no sha1
from a content change in the data recorded during the commit command
processing - so we need to look up the previous contents and use those
rather than crashing.

20 months agoAdd an initial switch implementation
Julian Phillips [Sat, 4 Sep 2010 18:18:27 +0000 (19:18 +0100)] 
Add an initial switch implementation

Create an implementation of the switch command by tweaking the update
command code to deal with the two URLs needed for switching.

We could probably actually use the switch code for both, just by
setting the new URL to the old URL for the update case ...

20 months agoGive svndiff Encoder a pre-image
Julian Phillips [Sat, 4 Sep 2010 18:17:16 +0000 (19:17 +0100)] 
Give svndiff Encoder a pre-image

If we have previous contents for the file, then give them to the
svndiff Encoder to use as a pre-image to hopefully reduce the amount
of data that we have to send.

20 months agoUse difflib to encode diffs when we have the pre-image
Julian Phillips [Sat, 4 Sep 2010 18:14:06 +0000 (19:14 +0100)] 
Use difflib to encode diffs when we have the pre-image

If we have a pre-image for the svndiff Encoder then use difflib to
actually create some form of diff.  This isn't as complete as the
Subversion diffing (we don't use copy from target at all) but it
should decrease the amount of data that we have to send for updates
and switches.

20 months agoImplement get-file-revs command
Julian Phillips [Fri, 3 Sep 2010 19:59:21 +0000 (20:59 +0100)] 
Implement get-file-revs command

The get-file-revs command is used by svn blame - implement at least
the basics, so svn blame will work for at least the simple cases.

20 months agoSubversion is now an apache project
Julian Phillips [Fri, 3 Sep 2010 19:58:25 +0000 (20:58 +0100)] 
Subversion is now an apache project

Which means they have moved their web repo access to apache.org URLs.

20 months agoAdd tags/branches to ls method
Julian Phillips [Thu, 2 Sep 2010 22:19:35 +0000 (23:19 +0100)] 
Add tags/branches to ls method

Add support for the tags and branches virtual directories to the ls
method.

20 months agoAdd support for top-level to ls method
Julian Phillips [Thu, 2 Sep 2010 22:19:04 +0000 (23:19 +0100)] 
Add support for top-level to ls method

Add support for the top-level virtual directory to the ls method.

20 months agoAdd support for tags/branches to stat method
Julian Phillips [Thu, 2 Sep 2010 22:16:37 +0000 (23:16 +0100)] 
Add support for tags/branches to stat method

Add support for the tags and branches virtual directories to the stat
method.

20 months agoAdd a function to look up commits using a pattern
Julian Phillips [Thu, 2 Sep 2010 22:14:02 +0000 (23:14 +0100)] 
Add a function to look up commits using a pattern

Sometimes we want to look for the most recent (up to the given
revision) commit that matches a given pattern.

20 months agoAdd support for looking up tags to commit functions
Julian Phillips [Thu, 2 Sep 2010 22:09:28 +0000 (23:09 +0100)] 
Add support for looking up tags to commit functions

When looking through the transaction table looking for commits, add
support for tags too.

20 months agoOnly close an open string
Julian Phillips [Thu, 2 Sep 2010 22:06:31 +0000 (23:06 +0100)] 
Only close an open string

If we don't have an open string then don't close it.

20 months agoFix a couple of issues with cat_file
Julian Phillips [Thu, 2 Sep 2010 22:04:00 +0000 (23:04 +0100)] 
Fix a couple of issues with cat_file

Add a tell method to GitCatFile and change it round so that it reads
the extra linefeed at the beginning rather than expecting one at the
end, as we sometimes seem to hang waiting for it.

20 months agoUse the correct max size for svndiff
Julian Phillips [Thu, 2 Sep 2010 22:02:13 +0000 (23:02 +0100)] 
Use the correct max size for svndiff

Subversion limits the size of a diff to 102400 bytes, so we need to do
so too otherwise Subversion will reject our diffs.

21 months agoSuite names must start with the word Test
Julian Phillips [Wed, 18 Aug 2010 18:39:24 +0000 (19:39 +0100)] 
Suite names must start with the word Test

2 years agovcs/git: Fix __commit_info vcs
Julian Phillips [Sun, 24 May 2009 10:42:17 +0000 (11:42 +0100)] 
vcs/git: Fix __commit_info

data should be a list so that when we try to extract the message we
get what we expect (a slice of a list of lines) rather than some
random slicing of a string.

3 years agotests: increase reliability of tests
Julian Phillips [Wed, 29 Apr 2009 19:03:02 +0000 (20:03 +0100)] 
tests: increase reliability of tests

Increase the wait for the server to start to increase the reliability
of the tests.

3 years agoAdd very basic support for creating tags and branches
Julian Phillips [Fri, 10 Apr 2009 11:40:32 +0000 (12:40 +0100)] 
Add very basic support for creating tags and branches

If you use the correct command, and have made all appropriate
sacrifices you can now create tags and branches using the Subversion
copy command.

3 years agovcs/git: Make GitData methods more robust
Julian Phillips [Fri, 10 Apr 2009 11:39:42 +0000 (12:39 +0100)] 
vcs/git: Make GitData methods more robust

Before trying to manipulate the underlying data stream, make sure that
we actually have one.

3 years agoauth: fix auth for Python 2.6
Julian Phillips [Fri, 10 Apr 2009 11:37:49 +0000 (12:37 +0100)] 
auth: fix auth for Python 2.6

With Python 2.6 we get a unicode string for the password instead of a
standard string - which we can't use with hmac.  So force it to be a
regular string.

3 years agoUse a single long-running git-cat-file instance
Julian Phillips [Tue, 7 Apr 2009 23:11:05 +0000 (00:11 +0100)] 
Use a single long-running git-cat-file instance

Rather than spawning a new git-cat-file instance each time we want to
retrieve data from git we create a single --batch instance for the
entire duration of the connection instead.

3 years agoUse the maximum possible zlib compression
Julian Phillips [Tue, 7 Apr 2009 23:09:27 +0000 (00:09 +0100)] 
Use the maximum possible zlib compression

In order to minimise the amount of data send over the network use the
maximum possible zlib compression level.

3 years agoDecouple getting the data from sending the data
Julian Phillips [Tue, 7 Apr 2009 23:08:22 +0000 (00:08 +0100)] 
Decouple getting the data from sending the data

By running the two tasks in parallel we can improve the wall time
taken.

3 years agoRemove some debug print statements
Julian Phillips [Sun, 5 Apr 2009 22:29:53 +0000 (23:29 +0100)] 
Remove some debug print statements

Remove a bunch of debug print statements that aren't that useful.

3 years agovcs/git: Add some comments to get_files
Julian Phillips [Sun, 5 Apr 2009 19:42:04 +0000 (20:42 +0100)] 
vcs/git: Add some comments to get_files

get_files is a rather long function, so for now add some comments.

3 years agovcs/git: Split the db access classes out
Julian Phillips [Sun, 5 Apr 2009 19:36:06 +0000 (20:36 +0100)] 
vcs/git: Split the db access classes out

Move the db access classes into their own module.

3 years agovcs/git: Change vcs/git from being a single module to a package
Julian Phillips [Sun, 5 Apr 2009 19:30:12 +0000 (20:30 +0100)] 
vcs/git: Change vcs/git from being a single module to a package

vcs/git.py was becoming rather large - nearly a third of the code
base.  Move it into a git package so that the code can later be split
up.

3 years agovcs/git: Convert .gitignore to svn:ignored property in get_files
Julian Phillips [Sun, 5 Apr 2009 18:52:06 +0000 (19:52 +0100)] 
vcs/git: Convert .gitignore to svn:ignored property in get_files

When returning data for update from get_files, translate .gitignore
files into svn:ignore properties on the containing directory.

3 years agovcs/git: Make log a generator function
Julian Phillips [Sun, 5 Apr 2009 17:56:24 +0000 (18:56 +0100)] 
vcs/git: Make log a generator function

Rather than making the user wait until we have generated all the log
entries before sending them to the client, use a generator function so
that each entry gets sent as it is ready.  This makes the user
experience much nicer.  It also means that we don't have to hold a
potentially large amount of data in memory.

3 years agovcs/git: Use a path with the log command to reduce irrelevant data
Julian Phillips [Sun, 5 Apr 2009 14:37:27 +0000 (15:37 +0100)] 
vcs/git: Use a path with the log command to reduce irrelevant data

When we are running update on a sub-path of the repository there is no
point in parsing a complete log, so pass the path that we want to look
at to the log command.

3 years agosvndiff: Make sure the client will understand zlib compressed data
Julian Phillips [Sun, 5 Apr 2009 14:35:22 +0000 (15:35 +0100)] 
svndiff: Make sure the client will understand zlib compressed data

In order for the client to know that data has been zlib compressed it
checks to see if the data length is less than the original data
length.  Which means that if the encoded data is as long as (or longer
than) then raw data we should just send the raw data.

3 years agoFix error handling for update so that it works
Julian Phillips [Sun, 5 Apr 2009 14:33:25 +0000 (15:33 +0100)] 
Fix error handling for update so that it works

Technically the error handling is still not 100% compliant with the
protocol description, but at least it works now.  In addition to
actually getting the client to recognise the end of the update command
we send it's error back to it so that it becomes visible to the user.

3 years agoRewrite get_files to be based on git log
Julian Phillips [Sun, 5 Apr 2009 12:46:36 +0000 (13:46 +0100)] 
Rewrite get_files to be based on git log

Rather than using lots of "git ls-tree" and "git cat-file commit"
calls, we can actually use a single "git log" call.  This is
significantly faster, whereas the original get_files was actually
slower than using ls and get_file.

3 years agoFix structure building in get_files
Julian Phillips [Sun, 5 Apr 2009 12:42:37 +0000 (13:42 +0100)] 
Fix structure building in get_files

The structure returned by get_files was being build incorrectly.  When
a parent entry was defaulted it was created with the first element as
the path of the parent, when it should be just the name.

3 years agoTreat merges as commits
Julian Phillips [Sun, 5 Apr 2009 12:38:51 +0000 (13:38 +0100)] 
Treat merges as commits

When looking for commits, we weren't treating merges as commits, which
we should have been.  In addition we were looking for 'create branch'
for branch points, when build_map is only using 'branch'.

Also remove the special case for 'delete branch', as it is the same as
the default handling.

3 years agoDon't try and look at the first tag when there are none left
Julian Phillips [Sun, 5 Apr 2009 12:34:49 +0000 (13:34 +0100)] 
Don't try and look at the first tag when there are none left

Previously we were always trying to look at the first of the remaining
tags, even if there were none left.  Now we check that there are some
tags left to look at first - which prevents the script from crashing
when it runs out of tags.

In addition if there are any tags left after adding all the commits,
add them at the end instead of ignoring them.

3 years agoupdate: use the new vcs get_files method
Julian Phillips [Thu, 2 Apr 2009 20:13:56 +0000 (21:13 +0100)] 
update: use the new vcs get_files method

Switch to using the get_files method instead of the ls and get_file
methods to get the tree of files for the new revision, as hopefully
this should be more efficient for complicated git repositories.

3 years agovcs: Add get_files function that returns a whole tree
Julian Phillips [Thu, 2 Apr 2009 20:10:13 +0000 (21:10 +0100)] 
vcs: Add get_files function that returns a whole tree

Given an url and a revision get_files will return a structure
containing the properties and contents of every path to be found under
that point.  For a git repository this will hopefully be more
efficient than using ls and get_file in combination, as we can run
through a single rev-list to get the last changed data, instead of
doing it for each file individually (which git isn't very good at).

3 years agoDon't run off the end of the source file in svndiff
Julian Phillips [Wed, 1 Apr 2009 23:49:30 +0000 (00:49 +0100)] 
Don't run off the end of the source file in svndiff

If the source file that we were generating an svndiff for was an exact
multiple of the chunk_size in length then we would go past the end and
try and create a diff window from no data.

3 years agoMisc fixes and improvements to update command
Julian Phillips [Wed, 1 Apr 2009 19:16:34 +0000 (20:16 +0100)] 
Misc fixes and improvements to update command

Some updates and fixes to the update command.

3 years agoAdd missing object to Encoder definition
Julian Phillips [Wed, 1 Apr 2009 19:15:29 +0000 (20:15 +0100)] 
Add missing object to Encoder definition

Not strictly necessary, but is more consistent

3 years agoAdd commit handling for svn:special and svn:executable
Julian Phillips [Tue, 31 Mar 2009 23:01:38 +0000 (00:01 +0100)] 
Add commit handling for svn:special and svn:executable

Since these two properties are reflected in the mode in git they can
be stored (and for the commit to be correct should be).  So add code
to make the necessary mappings for commit, the inverse of the mappings
already in place for update and similar commands.

3 years agoAdd support for sending svndiff1
Julian Phillips [Tue, 31 Mar 2009 20:03:53 +0000 (21:03 +0100)] 
Add support for sending svndiff1

If the client supports it, then send deltas encoded using svndiff1,
as the zlib should reduce network traffic.

3 years agoParse the optional extra arguments to update
Julian Phillips [Mon, 30 Mar 2009 22:57:06 +0000 (23:57 +0100)] 
Parse the optional extra arguments to update

The arguments aren't used yet, but now we parse them.

3 years agoHandle a path in update correctly
Julian Phillips [Mon, 30 Mar 2009 20:06:57 +0000 (21:06 +0100)] 
Handle a path in update correctly

If the client supplies a path in an update call then it wants us to
update the given path from the "root" of the current URL.  Previously
we would try and combine the path with URL to do the right thing -
which is how many commands work, but not this one.

3 years agoFix update so that delete-entry work properly
Julian Phillips [Mon, 30 Mar 2009 20:05:05 +0000 (21:05 +0100)] 
Fix update so that delete-entry work properly

Previously we forgot to prepand the current directory path onto the
entry name - which meant that the client would fail an assertion if we
tried to delete something from a sub-directory (as we would be telling
it to delete it from the top-level).

3 years agoRecord the URL of some more useful documents
Julian Phillips [Mon, 30 Mar 2009 00:04:53 +0000 (01:04 +0100)] 
Record the URL of some more useful documents

The Subversion SVN repos contains some documentation on various bit of
Subversion that can be useful.

3 years agoTidy up the server debug output, and add cl option to enable
Julian Phillips [Sun, 29 Mar 2009 18:02:44 +0000 (19:02 +0100)] 
Tidy up the server debug output, and add cl option to enable

Previously the debug output from the server module was controlled by a
global variable, and the caller had to compose the output.  Move the
composition into the function, move the function into the
SvnRequestHandler class, and control the output from a command-line
option.

3 years agoSort out the server announce message
Julian Phillips [Sun, 29 Mar 2009 17:50:26 +0000 (18:50 +0100)] 
Sort out the server announce message

Tidy up the server announce message a bit.  In particular, we might as
well announce the absent-entries capability - we support the commands
even if they currently aren't implemented.

3 years agoAdd support for receiving svndiff1
Julian Phillips [Sun, 29 Mar 2009 17:41:21 +0000 (18:41 +0100)] 
Add support for receiving svndiff1

Expand the svndiff module so that we can support receiving svndiff1 -
though we don't support generating it as yet.

3 years agoSubversion expects to be able to perform a stat on the top level
Julian Phillips [Sun, 29 Mar 2009 16:05:04 +0000 (17:05 +0100)] 
Subversion expects to be able to perform a stat on the top level

Since the is no mapping from the top level of a Subversion repository
to a real place in a git repository we have to make the results of the
stat up.  In addition, we need to be able to handle the stat of the
top-level for revision 0 where there is no "Last Changed Author" - so
we need to return an empty list for that bit of the response.

3 years agoDon't end the URL in a / if there is no path
Julian Phillips [Sun, 29 Mar 2009 15:58:01 +0000 (16:58 +0100)] 
Don't end the URL in a / if there is no path

If the caller hasn't supplied a path, then don't end the URL in a /.
If the caller does want a trailing / then they can always pass an
empty path.

3 years agoDon't hide what the URL was and should have been
Julian Phillips [Sun, 29 Mar 2009 15:56:17 +0000 (16:56 +0100)] 
Don't hide what the URL was and should have been

If we pass a message to the fail function, then we don't see the
values.  Which for the first two fails in check_svn_info makes sense -
however, for the last check it makes more sense to show the values if
they are not equal.

3 years agoAn empty repository should have revision 0
Julian Phillips [Sun, 29 Mar 2009 15:16:16 +0000 (16:16 +0100)] 
An empty repository should have revision 0

Rather than returning an error, when asked about an empty repository
we should say that it is at revision 0.

3 years agoAdd a test that git-svnserver looks like a Subversion server
Julian Phillips [Sun, 29 Mar 2009 15:13:41 +0000 (16:13 +0100)] 
Add a test that git-svnserver looks like a Subversion server

We ought to be able to call 'svn info <url_of_repo>' against
git-svnserver and get a complete response back including the url we
sent.  Even against an emptry repository.

Currently this fails, as the git backend can't cope with requests that
aren't directed against a branch.  And it doesn't like not have any
data in either and returns an error instead of revision 0.

3 years agoAdd Subversion and user bits to test lib
Julian Phillips [Sun, 29 Mar 2009 15:12:38 +0000 (16:12 +0100)] 
Add Subversion and user bits to test lib

Add some wrapper code for calling Subversion, and for managing users
in our git repositories to the test lib.

3 years agoIgnore a local copy of CleverSheep
Julian Phillips [Sun, 29 Mar 2009 15:09:50 +0000 (16:09 +0100)] 
Ignore a local copy of CleverSheep

An easy way to make CleverSheep available without installing it is to
put a copy in the test directory.  If we do this, then ignore it.

3 years agoIgnore test output files
Julian Phillips [Sun, 29 Mar 2009 15:08:55 +0000 (16:08 +0100)] 
Ignore test output files

When run the test framework can create some files - which we don't
want in the repository.

3 years agoFix parsing of authentication response
Julian Phillips [Sun, 29 Mar 2009 15:06:14 +0000 (16:06 +0100)] 
Fix parsing of authentication response

If the username had whitespace in it then we mis-split the response.
Split one item from the right hand end instead.

3 years agoAutomatically create a new empty git repository for each test
Julian Phillips [Sat, 28 Mar 2009 18:39:31 +0000 (18:39 +0000)] 
Automatically create a new empty git repository for each test

And also a matching git-svnserver config file to serve it.  This means
that the tests can now run without requiring any external setup.

Also a few other misc tidy ups and improvements to the test lib.

3 years agoAdd some more tests
Julian Phillips [Sat, 28 Mar 2009 12:25:55 +0000 (12:25 +0000)] 
Add some more tests

Adds some tests that we can actually control the IP and port that the
server uses.  Simple command-line option stuff - since the test lib
needs more work before it is ready for testing behaviour with a
Subversion client.

3 years agoStart adding some tests
Julian Phillips [Fri, 27 Mar 2009 21:42:29 +0000 (21:42 +0000)] 
Start adding some tests

At the moment there is only one test - that the server actually
starts, however this is mostly about getting the beginnings of a test
framework in place.  The framework itself still needs more work, as it
doesn't provide facilities for setting up the repository to serve, or
to drive the client for us.

3 years agoMake the --pidfile option always available
Julian Phillips [Fri, 27 Mar 2009 21:26:23 +0000 (21:26 +0000)] 
Make the --pidfile option always available

There is no good reason to limit the --pidfile option to only working
when running in daemon mode, so make it work in foreground mode again.

3 years agoMinor tidy to the output of the auth code
Julian Phillips [Fri, 27 Mar 2009 18:45:10 +0000 (18:45 +0000)] 
Minor tidy to the output of the auth code

Rather than printing the authentication response as received from the
client print a message when we have authenticated a user.

3 years agoAdd an option to store the pid of the daemon in a file
Julian Phillips [Fri, 27 Mar 2009 18:43:48 +0000 (18:43 +0000)] 
Add an option to store the pid of the daemon in a file

Now you can ask git-svnserver to store the pid of the daemon process
in a file, making it easier to kill it off later.

Also tidy up the passing of options to the server - simply pass the
whole options object, rather than passing each bit of informtaion on
its own.

3 years agoImplement get_auth function from Repos API
Julian Phillips [Fri, 27 Mar 2009 17:14:31 +0000 (17:14 +0000)] 
Implement get_auth function from Repos API

Since this backend is only really to support protocol development, we
just use the DummyAuthDb rather than bothering to implement a proper
authentication database.

3 years agoAdd a DummyAuthDb class that shows the auth db interface
Julian Phillips [Fri, 27 Mar 2009 17:12:13 +0000 (17:12 +0000)] 
Add a DummyAuthDb class that shows the auth db interface

It also allows backends that don't want to care about authentication
to use something that already exists rather than having to write their
own Dummy.

3 years agoget_auth is now part of the Repos API
Julian Phillips [Fri, 27 Mar 2009 17:11:38 +0000 (17:11 +0000)] 
get_auth is now part of the Repos API

So it should be in the Repos base class

3 years agoRename the example config file
Julian Phillips [Fri, 27 Mar 2009 16:41:03 +0000 (16:41 +0000)] 
Rename the example config file

test.cfg is not really an obvious name for an example config file.