Revision: 5970
Author: a_engels
Date: 2008-10-15 07:16:05 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
Added Paths:
-----------
trunk/pywikipedia/README.txt
trunk/pywikipedia/conf/
trunk/pywikipedia/conf/authz
trunk/pywikipedia/conf/passwd
trunk/pywikipedia/conf/svnserve.conf
trunk/pywikipedia/db/
trunk/pywikipedia/db/current
trunk/pywikipedia/db/format
trunk/pywikipedia/db/fs-type
trunk/pywikipedia/db/revprops/
trunk/pywikipedia/db/revprops/0/
trunk/pywikipedia/db/revprops/0/0
trunk/pywikipedia/db/revs/
trunk/pywikipedia/db/revs/0/
trunk/pywikipedia/db/revs/0/0
trunk/pywikipedia/db/transactions/
trunk/pywikipedia/db/txn-current
trunk/pywikipedia/db/txn-current-lock
trunk/pywikipedia/db/txn-protorevs/
trunk/pywikipedia/db/uuid
trunk/pywikipedia/db/write-lock
trunk/pywikipedia/format
trunk/pywikipedia/hooks/
trunk/pywikipedia/hooks/post-commit.tmpl
trunk/pywikipedia/hooks/post-lock.tmpl
trunk/pywikipedia/hooks/post-revprop-change.tmpl
trunk/pywikipedia/hooks/post-unlock.tmpl
trunk/pywikipedia/hooks/pre-commit.tmpl
trunk/pywikipedia/hooks/pre-lock.tmpl
trunk/pywikipedia/hooks/pre-revprop-change.tmpl
trunk/pywikipedia/hooks/pre-unlock.tmpl
trunk/pywikipedia/hooks/start-commit.tmpl
trunk/pywikipedia/locks/
trunk/pywikipedia/locks/db-logs.lock
trunk/pywikipedia/locks/db.lock
Added: trunk/pywikipedia/README.txt
===================================================================
--- trunk/pywikipedia/README.txt (rev 0)
+++ trunk/pywikipedia/README.txt 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,5 @@
+This is a Subversion repository; use the 'svnadmin' tool to examine
+it. Do not add, delete, or modify files here unless you know how
+to avoid corrupting the repository.
+
+Visit http://subversion.tigris.org/ for more information.
Added: trunk/pywikipedia/conf/authz
===================================================================
--- trunk/pywikipedia/conf/authz (rev 0)
+++ trunk/pywikipedia/conf/authz 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,32 @@
+### This file is an example authorization file for svnserve.
+### Its format is identical to that of mod_authz_svn authorization
+### files.
+### As shown below each section defines authorizations for the path and
+### (optional) repository specified by the section name.
+### The authorizations follow. An authorization line can refer to:
+### - a single user,
+### - a group of users defined in a special [groups] section,
+### - an alias defined in a special [aliases] section,
+### - all authenticated users, using the '$authenticated' token,
+### - only anonymous users, using the '$anonymous' token,
+### - anyone, using the '*' wildcard.
+###
+### A match can be inverted by prefixing the rule with '~'. Rules can
+### grant read ('r') access, read-write ('rw') access, or no access
+### ('').
+
+[aliases]
+# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
+
+[groups]
+# harry_and_sally = harry,sally
+# harry_sally_and_joe = harry,sally,&joe
+
+# [/foo/bar]
+# harry = rw
+# &joe = r
+# * =
+
+# [repository:/baz/fuz]
+# @harry_and_sally = rw
+# * = r
Added: trunk/pywikipedia/conf/passwd
===================================================================
--- trunk/pywikipedia/conf/passwd (rev 0)
+++ trunk/pywikipedia/conf/passwd 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,8 @@
+### 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
Added: trunk/pywikipedia/conf/svnserve.conf
===================================================================
--- trunk/pywikipedia/conf/svnserve.conf (rev 0)
+++ trunk/pywikipedia/conf/svnserve.conf 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,47 @@
+### This file controls the configuration of the svnserve daemon, if you
+### use it to allow access to this repository. (If you only allow
+### access through http: and/or file: URLs, then this file is
+### irrelevant.)
+
+### Visit http://subversion.tigris.org/ for more information.
+
+[general]
+### These options control access to the repository for unauthenticated
+### and authenticated users. Valid values are "write", "read",
+### and "none". The sample settings below are the defaults.
+# anon-access = read
+# auth-access = write
+### The password-db option controls the location of the password
+### database file. Unless you specify a path starting with a /,
+### the file's location is relative to the directory containing
+### this configuration file.
+### If SASL is enabled (see below), this file will NOT be used.
+### Uncomment the line below to use the default password file.
+# password-db = passwd
+### The authz-db option controls the location of the authorization
+### rules for path-based access control. Unless you specify a path
+### starting with a /, the file's location is relative to the the
+### directory containing this file. If you don't specify an
+### authz-db, no path-based access control is done.
+### Uncomment the line below to use the default authorization file.
+# authz-db = authz
+### This option specifies the authentication realm of the repository.
+### If two repositories have the same authentication realm, they should
+### have the same password database, and vice versa. The default realm
+### is repository's uuid.
+# realm = My First Repository
+
+[sasl]
+### This option specifies whether you want to use the Cyrus SASL
+### library for authentication. Default is false.
+### This section will be ignored if svnserve is not built with Cyrus
+### SASL support; to check, run 'svnserve --version' and look for a line
+### reading 'Cyrus SASL authentication is available.'
+# use-sasl = true
+### These options specify the desired strength of the security layer
+### that you want SASL to provide. 0 means no encryption, 1 means
+### integrity-checking only, values larger than 1 are correlated
+### to the effective key length for encryption (e.g. 128 means 128-bit
+### encryption). The values below are the defaults.
+# min-encryption = 0
+# max-encryption = 256
Added: trunk/pywikipedia/db/current
===================================================================
--- trunk/pywikipedia/db/current (rev 0)
+++ trunk/pywikipedia/db/current 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1 @@
+0
Added: trunk/pywikipedia/db/format
===================================================================
--- trunk/pywikipedia/db/format (rev 0)
+++ trunk/pywikipedia/db/format 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,2 @@
+3
+layout sharded 1000
Added: trunk/pywikipedia/db/fs-type
===================================================================
--- trunk/pywikipedia/db/fs-type (rev 0)
+++ trunk/pywikipedia/db/fs-type 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1 @@
+fsfs
Added: trunk/pywikipedia/db/revprops/0/0
===================================================================
--- trunk/pywikipedia/db/revprops/0/0 (rev 0)
+++ trunk/pywikipedia/db/revprops/0/0 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,5 @@
+K 8
+svn:date
+V 27
+2008-10-15T07:15:53.542241Z
+END
Added: trunk/pywikipedia/db/revs/0/0
===================================================================
--- trunk/pywikipedia/db/revs/0/0 (rev 0)
+++ trunk/pywikipedia/db/revs/0/0 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,11 @@
+PLAIN
+END
+ENDREP
+id: 0.0.r0/17
+type: dir
+count: 0
+text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
+cpath: /
+
+
+17 107
Added: trunk/pywikipedia/db/txn-current
===================================================================
--- trunk/pywikipedia/db/txn-current (rev 0)
+++ trunk/pywikipedia/db/txn-current 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1 @@
+0
Added: trunk/pywikipedia/db/uuid
===================================================================
--- trunk/pywikipedia/db/uuid (rev 0)
+++ trunk/pywikipedia/db/uuid 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1 @@
+b6d746c0-3985-974f-8d6a-769f6a6751d4
Added: trunk/pywikipedia/format
===================================================================
--- trunk/pywikipedia/format (rev 0)
+++ trunk/pywikipedia/format 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1 @@
+5
Added: trunk/pywikipedia/hooks/post-commit.tmpl
===================================================================
--- trunk/pywikipedia/hooks/post-commit.tmpl (rev 0)
+++ trunk/pywikipedia/hooks/post-commit.tmpl 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# POST-COMMIT HOOK
+#
+# The post-commit hook is invoked after a commit. Subversion runs
+# this hook by invoking a program (script, executable, binary, etc.)
+# named 'post-commit' (for which this file is a template) with the
+# following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] REV (the number of the revision just committed)
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# Because the commit has already completed and cannot be undone,
+# the exit code of the hook program is ignored. The hook program
+# can use the 'svnlook' utility to help it examine the
+# newly-committed tree.
+#
+# On a Unix system, the normal procedure is to have 'post-commit'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'post-commit' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'post-commit.bat' or 'post-commit.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# the Subversion repository at
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+REV="$2"
+
+commit-email.pl "$REPOS" "$REV" commit-watchers(a)example.org
+log-commit.py --repository "$REPOS" --revision "$REV"
Added: trunk/pywikipedia/hooks/post-lock.tmpl
===================================================================
--- trunk/pywikipedia/hooks/post-lock.tmpl (rev 0)
+++ trunk/pywikipedia/hooks/post-lock.tmpl 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# POST-LOCK HOOK
+#
+# The post-lock hook is run after a path is locked. Subversion runs
+# this hook by invoking a program (script, executable, binary, etc.)
+# named 'post-lock' (for which this file is a template) with the
+# following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] USER (the user who created the lock)
+#
+# The paths that were just locked are passed to the hook via STDIN (as
+# of Subversion 1.2, only one path is passed per invocation, but the
+# plan is to pass all locked paths at once, so the hook program
+# should be written accordingly).
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# Because the lock has already been created and cannot be undone,
+# the exit code of the hook program is ignored. The hook program
+# can use the 'svnlook' utility to help it examine the
+# newly-created lock.
+#
+# On a Unix system, the normal procedure is to have 'post-lock'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'post-lock' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'post-lock.bat' or 'post-lock.exe',
+# but the basic idea is the same.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter:
+
+REPOS="$1"
+USER="$2"
+
+# Send email to interested parties, let them know a lock was created:
+mailer.py lock "$REPOS" "$USER" /path/to/mailer.conf
Added: trunk/pywikipedia/hooks/post-revprop-change.tmpl
===================================================================
--- trunk/pywikipedia/hooks/post-revprop-change.tmpl (rev 0)
+++ trunk/pywikipedia/hooks/post-revprop-change.tmpl 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# POST-REVPROP-CHANGE HOOK
+#
+# The post-revprop-change hook is invoked after a revision property
+# has been added, modified or deleted. Subversion runs this hook by
+# invoking a program (script, executable, binary, etc.) named
+# 'post-revprop-change' (for which this file is a template), with the
+# following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] REV (the revision that was tweaked)
+# [3] USER (the username of the person tweaking the property)
+# [4] PROPNAME (the property that was changed)
+# [5] ACTION (the property was 'A'dded, 'M'odified, or 'D'eleted)
+#
+# [STDIN] PROPVAL ** the old property value is passed via STDIN.
+#
+# Because the propchange has already completed and cannot be undone,
+# the exit code of the hook program is ignored. The hook program
+# can use the 'svnlook' utility to help it examine the
+# new property value.
+#
+# On a Unix system, the normal procedure is to have 'post-revprop-change'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'post-revprop-change' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'post-revprop-change.bat' or 'post-revprop-change.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# the Subversion repository at
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+REV="$2"
+USER="$3"
+PROPNAME="$4"
+ACTION="$5"
+
+commit-email.pl --revprop-change "$REPOS" "$REV" "$USER" "$PROPNAME" watchers(a)example.org
Added: trunk/pywikipedia/hooks/post-unlock.tmpl
===================================================================
--- trunk/pywikipedia/hooks/post-unlock.tmpl (rev 0)
+++ trunk/pywikipedia/hooks/post-unlock.tmpl 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# POST-UNLOCK HOOK
+#
+# The post-unlock hook runs after a path is unlocked. Subversion runs
+# this hook by invoking a program (script, executable, binary, etc.)
+# named 'post-unlock' (for which this file is a template) with the
+# following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] USER (the user who destroyed the lock)
+#
+# The paths that were just unlocked are passed to the hook via STDIN
+# (as of Subversion 1.2, only one path is passed per invocation, but
+# the plan is to pass all unlocked paths at once, so the hook program
+# should be written accordingly).
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# Because the lock has already been destroyed and cannot be undone,
+# the exit code of the hook program is ignored.
+#
+# On a Unix system, the normal procedure is to have 'post-unlock'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'post-unlock' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'post-unlock.bat' or 'post-unlock.exe',
+# but the basic idea is the same.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter:
+
+REPOS="$1"
+USER="$2"
+
+# Send email to interested parties, let them know a lock was removed:
+mailer.py unlock "$REPOS" "$USER" /path/to/mailer.conf
Added: trunk/pywikipedia/hooks/pre-commit.tmpl
===================================================================
--- trunk/pywikipedia/hooks/pre-commit.tmpl (rev 0)
+++ trunk/pywikipedia/hooks/pre-commit.tmpl 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# PRE-COMMIT HOOK
+#
+# The pre-commit hook is invoked before a Subversion txn is
+# committed. Subversion runs this hook by invoking a program
+# (script, executable, binary, etc.) named 'pre-commit' (for which
+# this file is a template), with the following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] TXN-NAME (the name of the txn about to be committed)
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# If the hook program exits with success, the txn is committed; but
+# if it exits with failure (non-zero), the txn is aborted, no commit
+# takes place, and STDERR is returned to the client. The hook
+# program can use the 'svnlook' utility to help it examine the txn.
+#
+# On a Unix system, the normal procedure is to have 'pre-commit'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT ***
+# *** FOR REVISION PROPERTIES (like svn:log or svn:author). ***
+#
+# This is why we recommend using the read-only 'svnlook' utility.
+# In the future, Subversion may enforce the rule that pre-commit
+# hooks should not modify the versioned data in txns, or else come
+# up with a mechanism to make it safe to do so (by informing the
+# committing client of the changes). However, right now neither
+# mechanism is implemented, so hook writers just have to be careful.
+#
+# Note that 'pre-commit' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'pre-commit.bat' or 'pre-commit.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# the Subversion repository at
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+TXN="$2"
+
+# Make sure that the log message contains some text.
+SVNLOOK=/usr/local/bin/svnlook
+$SVNLOOK log -t "$TXN" "$REPOS" | \
+ grep "[a-zA-Z0-9]" > /dev/null || exit 1
+
+# Check that the author of this commit has the rights to perform
+# the commit on the files and directories being modified.
+commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1
+
+# All checks passed, so allow the commit.
+exit 0
Added: trunk/pywikipedia/hooks/pre-lock.tmpl
===================================================================
--- trunk/pywikipedia/hooks/pre-lock.tmpl (rev 0)
+++ trunk/pywikipedia/hooks/pre-lock.tmpl 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+# PRE-LOCK HOOK
+#
+# The pre-lock hook is invoked before an exclusive lock is
+# created. Subversion runs this hook by invoking a program
+# (script, executable, binary, etc.) named 'pre-lock' (for which
+# this file is a template), with the following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] PATH (the path in the repository about to be locked)
+# [3] USER (the user creating the lock)
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# If the hook program exits with success, the lock is created; but
+# if it exits with failure (non-zero), the lock action is aborted
+# and STDERR is returned to the client.
+
+# On a Unix system, the normal procedure is to have 'pre-lock'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'pre-lock' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'pre-lock.bat' or 'pre-lock.exe',
+# but the basic idea is the same.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter:
+
+REPOS="$1"
+PATH="$2"
+USER="$3"
+
+# If a lock exists and is owned by a different person, don't allow it
+# to be stolen (e.g., with 'svn lock --force ...').
+
+# (Maybe this script could send email to the lock owner?)
+SVNLOOK=/usr/local/bin/svnlook
+GREP=/bin/grep
+SED=/bin/sed
+
+LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \
+ $GREP '^Owner: ' | $SED 's/Owner: //'`
+
+# If we get no result from svnlook, there's no lock, allow the lock to
+# happen:
+if [ "$LOCK_OWNER" = "" ]; then
+ exit 0
+fi
+
+# If the person locking matches the lock's owner, allow the lock to
+# happen:
+if [ "$LOCK_OWNER" = "$USER" ]; then
+ exit 0
+fi
+
+# Otherwise, we've got an owner mismatch, so return failure:
+echo "Error: $PATH already locked by ${LOCK_OWNER}." 1>&2
+exit 1
Added: trunk/pywikipedia/hooks/pre-revprop-change.tmpl
===================================================================
--- trunk/pywikipedia/hooks/pre-revprop-change.tmpl (rev 0)
+++ trunk/pywikipedia/hooks/pre-revprop-change.tmpl 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+# PRE-REVPROP-CHANGE HOOK
+#
+# The pre-revprop-change hook is invoked before a revision property
+# is added, modified or deleted. Subversion runs this hook by invoking
+# a program (script, executable, binary, etc.) named 'pre-revprop-change'
+# (for which this file is a template), with the following ordered
+# arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] REVISION (the revision being tweaked)
+# [3] USER (the username of the person tweaking the property)
+# [4] PROPNAME (the property being set on the revision)
+# [5] ACTION (the property is being 'A'dded, 'M'odified, or 'D'eleted)
+#
+# [STDIN] PROPVAL ** the new property value is passed via STDIN.
+#
+# If the hook program exits with success, the propchange happens; but
+# if it exits with failure (non-zero), the propchange doesn't happen.
+# The hook program can use the 'svnlook' utility to examine the
+# existing value of the revision property.
+#
+# WARNING: unlike other hooks, this hook MUST exist for revision
+# properties to be changed. If the hook does not exist, Subversion
+# will behave as if the hook were present, but failed. The reason
+# for this is that revision properties are UNVERSIONED, meaning that
+# a successful propchange is destructive; the old value is gone
+# forever. We recommend the hook back up the old value somewhere.
+#
+# On a Unix system, the normal procedure is to have 'pre-revprop-change'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'pre-revprop-change' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'pre-revprop-change.bat' or 'pre-revprop-change.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# the Subversion repository at
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+REV="$2"
+USER="$3"
+PROPNAME="$4"
+ACTION="$5"
+
+if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
+
+echo "Changing revision properties other than svn:log is prohibited" >&2
+exit 1
Added: trunk/pywikipedia/hooks/pre-unlock.tmpl
===================================================================
--- trunk/pywikipedia/hooks/pre-unlock.tmpl (rev 0)
+++ trunk/pywikipedia/hooks/pre-unlock.tmpl 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# PRE-UNLOCK HOOK
+#
+# The pre-unlock hook is invoked before an exclusive lock is
+# destroyed. Subversion runs this hook by invoking a program
+# (script, executable, binary, etc.) named 'pre-unlock' (for which
+# this file is a template), with the following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] PATH (the path in the repository about to be unlocked)
+# [3] USER (the user destroying the lock)
+#
+# The default working directory for the invocation is undefined, so
+# the program should set one explicitly if it cares.
+#
+# If the hook program exits with success, the lock is destroyed; but
+# if it exits with failure (non-zero), the unlock action is aborted
+# and STDERR is returned to the client.
+
+# On a Unix system, the normal procedure is to have 'pre-unlock'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'pre-unlock' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'pre-unlock.bat' or 'pre-unlock.exe',
+# but the basic idea is the same.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter:
+
+REPOS="$1"
+PATH="$2"
+USER="$3"
+
+# If a lock is owned by a different person, don't allow it be broken.
+# (Maybe this script could send email to the lock owner?)
+
+SVNLOOK=/usr/local/bin/svnlook
+GREP=/bin/grep
+SED=/bin/sed
+
+LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \
+ $GREP '^Owner: ' | $SED 's/Owner: //'`
+
+# If we get no result from svnlook, there's no lock, return success:
+if [ "$LOCK_OWNER" = "" ]; then
+ exit 0
+fi
+
+# If the person unlocking matches the lock's owner, return success:
+if [ "$LOCK_OWNER" = "$USER" ]; then
+ exit 0
+fi
+
+# Otherwise, we've got an owner mismatch, so return failure:
+echo "Error: $PATH locked by ${LOCK_OWNER}." 1>&2
+exit 1
Added: trunk/pywikipedia/hooks/start-commit.tmpl
===================================================================
--- trunk/pywikipedia/hooks/start-commit.tmpl (rev 0)
+++ trunk/pywikipedia/hooks/start-commit.tmpl 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+# START-COMMIT HOOK
+#
+# The start-commit hook is invoked before a Subversion txn is created
+# in the process of doing a commit. Subversion runs this hook
+# by invoking a program (script, executable, binary, etc.) named
+# 'start-commit' (for which this file is a template)
+# with the following ordered arguments:
+#
+# [1] REPOS-PATH (the path to this repository)
+# [2] USER (the authenticated user attempting to commit)
+# [3] CAPABILITIES (a colon-separated list of capabilities reported
+# by the client; see note below)
+#
+# Note: The CAPABILITIES parameter is new in Subversion 1.5, and 1.5
+# clients will typically report at least the "mergeinfo" capability.
+# If there are other capabilities, then the list is colon-separated,
+# e.g.: "mergeinfo:some-other-capability" (the order is undefined).
+#
+# The list is self-reported by the client. Therefore, you should not
+# make security assumptions based on the capabilities list, nor should
+# you assume that clients reliably report every capability they have.
+#
+# The working directory for this hook program's invocation is undefined,
+# so the program should set one explicitly if it cares.
+#
+# If the hook program exits with success, the commit continues; but
+# if it exits with failure (non-zero), the commit is stopped before
+# a Subversion txn is created, and STDERR is returned to the client.
+#
+# On a Unix system, the normal procedure is to have 'start-commit'
+# invoke other programs to do the real work, though it may do the
+# work itself too.
+#
+# Note that 'start-commit' must be executable by the user(s) who will
+# invoke it (typically the user httpd runs as), and that user must
+# have filesystem-level permission to access the repository.
+#
+# On a Windows system, you should name the hook program
+# 'start-commit.bat' or 'start-commit.exe',
+# but the basic idea is the same.
+#
+# The hook program typically does not inherit the environment of
+# its parent process. For example, a common problem is for the
+# PATH environment variable to not be set to its usual value, so
+# that subprograms fail to launch unless invoked via absolute path.
+# If you're having unexpected problems with a hook program, the
+# culprit may be unusual (or missing) environment variables.
+#
+# Here is an example hook script, for a Unix /bin/sh interpreter.
+# For more examples and pre-written hooks, see those in
+# the Subversion repository at
+# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
+# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
+
+
+REPOS="$1"
+USER="$2"
+
+commit-allower.pl --repository "$REPOS" --user "$USER" || exit 1
+special-auth-check.py --user "$USER" --auth-level 3 || exit 1
+
+# All checks passed, so allow the commit.
+exit 0
Added: trunk/pywikipedia/locks/db-logs.lock
===================================================================
--- trunk/pywikipedia/locks/db-logs.lock (rev 0)
+++ trunk/pywikipedia/locks/db-logs.lock 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,3 @@
+This file is not used by Subversion 1.3.x or later.
+However, its existence is required for compatibility with
+Subversion 1.2.x or earlier.
Added: trunk/pywikipedia/locks/db.lock
===================================================================
--- trunk/pywikipedia/locks/db.lock (rev 0)
+++ trunk/pywikipedia/locks/db.lock 2008-10-15 07:16:05 UTC (rev 5970)
@@ -0,0 +1,3 @@
+This file is not used by Subversion 1.3.x or later.
+However, its existence is required for compatibility with
+Subversion 1.2.x or earlier.
Revision: 5972
Author: a_engels
Date: 2008-10-15 07:20:05 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
adding option -min, allowing one to work only on disambiguation pages with a certain minimum number of links.
Modified Paths:
--------------
trunk/pywikipedia/solve_disambiguation.py
Modified: trunk/pywikipedia/solve_disambiguation.py
===================================================================
--- trunk/pywikipedia/solve_disambiguation.py 2008-10-15 07:18:52 UTC (rev 5971)
+++ trunk/pywikipedia/solve_disambiguation.py 2008-10-15 07:20:05 UTC (rev 5972)
@@ -53,6 +53,9 @@
that is defined (to the bot) as the category containing disambiguation
pages, starting at XY. If only '-start' or '-start:' is given, it starts
at the beginning.
+
+ -min:XX (XX being a number) only work on disambiguation pages for which
+ at least XX are to be worked on.
To complete a move of a page, one can use:
@@ -395,12 +398,13 @@
return linkupper
class ReferringPageGeneratorWithIgnore:
- def __init__(self, disambPage, primary=False):
+ def __init__(self, disambPage, primary=False, minimum = 0):
self.disambPage = disambPage
# if run with the -primary argument, enable the ignore manager
self.primaryIgnoreManager = PrimaryIgnoreManager(disambPage,
enabled=primary)
-
+ self.minimum = minimum
+
def __iter__(self):
# TODO: start yielding before all referring pages have been found
refs = [page for page in self.disambPage.getReferences(follow_redirects = False, withTemplateInclusion = False)]
@@ -417,6 +421,9 @@
elif self.primaryIgnoreManager.isIgnored(refs[i]):
#wikipedia.output('Ignoring page %s because it was skipped before' % refs[i].title())
del refs[i]
+ if len(refs) < self.minimum:
+ wikipedia.output(u"Found only %d pages to work on; skipping." % len(refs))
+ return
wikipedia.output(u"Will work on %d pages." % len(refs))
for ref in refs:
yield ref
@@ -489,13 +496,14 @@
'hu': u'Egyért-redir',
}
- def __init__(self, always, alternatives, getAlternatives, generator, primary, main_only):
+ def __init__(self, always, alternatives, getAlternatives, generator, primary, main_only, minimum = 0):
self.always = always
self.alternatives = alternatives
self.getAlternatives = getAlternatives
self.generator = generator
self.primary = primary
self.main_only = main_only
+ self.minimum = minimum
self.mysite = wikipedia.getSite()
self.mylang = self.mysite.language()
@@ -898,7 +906,7 @@
self.alternatives.sort()
self.listAlternatives()
- gen = ReferringPageGeneratorWithIgnore(disambPage, self.primary)
+ gen = ReferringPageGeneratorWithIgnore(disambPage, self.primary, minimum = self.minimum)
preloadingGen = pagegenerators.PreloadingGenerator(gen)
for refPage in preloadingGen:
if not self.primaryIgnoreManager.isIgnored(refPage):
@@ -926,6 +934,7 @@
# For sorting the linked pages, case can be ignored
ignoreCase = False
+ minimum = 0
for arg in wikipedia.handleArgs():
if arg.startswith('-primary:'):
@@ -958,6 +967,8 @@
getAlternatives = False
elif arg == '-main':
main_only = True
+ elif arg.startswith('-min:'):
+ minimum = int(arg[5:])
elif arg.startswith('-start'):
try:
if len(arg) <= len('-start:'):
@@ -989,7 +1000,7 @@
page = wikipedia.Page(wikipedia.getSite(), pageTitle)
generator = iter([page])
- bot = DisambiguationRobot(always, alternatives, getAlternatives, generator, primary, main_only)
+ bot = DisambiguationRobot(always, alternatives, getAlternatives, generator, primary, main_only, minimum = minimum)
bot.run()
Revision: 5969
Author: jayvdb
Date: 2008-10-14 23:24:04 +0000 (Tue, 14 Oct 2008)
Log Message:
-----------
Help update: param "index" is now optional
Modified Paths:
--------------
trunk/pywikipedia/djvutext.py
Modified: trunk/pywikipedia/djvutext.py
===================================================================
--- trunk/pywikipedia/djvutext.py 2008-10-14 19:22:40 UTC (rev 5968)
+++ trunk/pywikipedia/djvutext.py 2008-10-14 23:24:04 UTC (rev 5969)
@@ -10,8 +10,9 @@
what would have been changed.
-ask Ask for confirmation before uploading each page.
(Default: ask when overwriting pages)
+ -djvu:... Filename of the djvu file
-index:... Name of the index page
- -djvu:... Filename of the djvu file
+ (Default: the djvu filename)
-pages:<start>-<end> Page range to upload; <end> is optional
All other parameters will be regarded as part of the title of a single page,
@@ -122,7 +123,7 @@
return False
def get_page(self, pageno):
- wikipedia.output("fetching page %d" % (pageno))
+ wikipedia.output(unicode("fetching page %d" % (pageno)))
cmd = "djvutxt -page=%d \"%s\" \"%s.out\"" % (pageno, self.djvu, self.djvu)
os.system ( cmd )
Revision: 5967
Author: russblau
Date: 2008-10-14 19:14:57 +0000 (Tue, 14 Oct 2008)
Log Message:
-----------
more tests and one bug-fix uncovered by testing
Modified Paths:
--------------
branches/rewrite/pywikibot/site.py
branches/rewrite/pywikibot/tests/site_tests.py
Modified: branches/rewrite/pywikibot/site.py
===================================================================
--- branches/rewrite/pywikibot/site.py 2008-10-14 15:18:24 UTC (rev 5966)
+++ branches/rewrite/pywikibot/site.py 2008-10-14 19:14:57 UTC (rev 5967)
@@ -1326,7 +1326,7 @@
"""
acgen = api.CategoryPageGenerator("allcategories",
- gapfrom=start, site=self)
+ gacfrom=start, site=self)
if prefix:
acgen.request["gacprefix"] = prefix
if isinstance(limit, int):
Modified: branches/rewrite/pywikibot/tests/site_tests.py
===================================================================
--- branches/rewrite/pywikibot/tests/site_tests.py 2008-10-14 15:18:24 UTC (rev 5966)
+++ branches/rewrite/pywikibot/tests/site_tests.py 2008-10-14 19:14:57 UTC (rev 5967)
@@ -220,7 +220,7 @@
set(mysite.pagelinks(mainpage, namespaces=[0, 1]))))
for target in mysite.preloadpages(
mysite.pagelinks(mainpage, follow_redirects=True,
- limit=10)):
+ limit=5)):
self.assertType(target, pywikibot.Page)
self.assertFalse(target.isRedirectPage())
# test pagecategories
@@ -249,7 +249,7 @@
mysite.loadrevisions(mainpage)
self.assertTrue(hasattr(mainpage, "_revid"))
self.assertTrue(hasattr(mainpage, "_revisions"))
- self.assertTrue(mainpage._revisions.has_key(mainpage._revid))
+ self.assertTrue(mainpage._revid in mainpage._revisions)
# TODO test all the optional arguments
def testAllPages(self):
@@ -268,43 +268,43 @@
self.assertTrue(mysite.page_exists(page))
self.assertEqual(page.namespace(), 0)
self.assertTrue(page.title() <= "Aa")
- for page in mysite.allpages(start="Py", limit=10):
+ for page in mysite.allpages(start="Py", limit=5):
self.assertType(page, pywikibot.Page)
self.assertTrue(mysite.page_exists(page))
self.assertEqual(page.namespace(), 0)
self.assertTrue(page.title() >= "Py")
- for page in mysite.allpages(prefix="Pre", limit=10):
+ for page in mysite.allpages(prefix="Pre", limit=5):
self.assertType(page, pywikibot.Page)
self.assertTrue(mysite.page_exists(page))
self.assertEqual(page.namespace(), 0)
self.assertTrue(page.title().startswith("Pre"))
- for page in mysite.allpages(namespace=1, limit=10):
+ for page in mysite.allpages(namespace=1, limit=5):
self.assertType(page, pywikibot.Page)
self.assertTrue(mysite.page_exists(page))
self.assertEqual(page.namespace(), 1)
- for page in mysite.allpages(filterredir=True, limit=10):
+ for page in mysite.allpages(filterredir=True, limit=5):
self.assertType(page, pywikibot.Page)
self.assertTrue(mysite.page_exists(page))
self.assertEqual(page.namespace(), 0)
self.assertTrue(page.isRedirectPage())
- for page in mysite.allpages(filterredir=False, limit=10):
+ for page in mysite.allpages(filterredir=False, limit=5):
self.assertType(page, pywikibot.Page)
self.assertTrue(mysite.page_exists(page))
self.assertEqual(page.namespace(), 0)
self.assertFalse(page.isRedirectPage())
- for page in mysite.allpages(filterlanglinks=True, limit=10):
+ for page in mysite.allpages(filterlanglinks=True, limit=5):
self.assertType(page, pywikibot.Page)
self.assertTrue(mysite.page_exists(page))
self.assertEqual(page.namespace(), 0)
- for page in mysite.allpages(filterlanglinks=False, limit=10):
+ for page in mysite.allpages(filterlanglinks=False, limit=5):
self.assertType(page, pywikibot.Page)
self.assertTrue(mysite.page_exists(page))
self.assertEqual(page.namespace(), 0)
- for page in mysite.allpages(minsize=100, limit=10):
+ for page in mysite.allpages(minsize=100, limit=5):
self.assertType(page, pywikibot.Page)
self.assertTrue(mysite.page_exists(page))
self.assertTrue(len(page.text) >= 100)
- for page in mysite.allpages(maxsize=200, limit=10):
+ for page in mysite.allpages(maxsize=200, limit=5):
self.assertType(page, pywikibot.Page)
self.assertTrue(mysite.page_exists(page))
self.assertTrue(len(page.text) <= 200)
@@ -327,23 +327,24 @@
self.assertTrue(all(isinstance(link, pywikibot.Page) for link in fwd))
uniq = list(mysite.alllinks(limit=10, unique=True))
self.assertTrue(all(link in uniq for link in fwd))
- # TODO: test various optional arguments to alllinks
- for page in mysite.alllinks(start="Link", limit=10):
+ for page in mysite.alllinks(start="Link", limit=5):
self.assertType(page, pywikibot.Page)
self.assertEqual(page.namespace(), 0)
self.assertTrue(page.title() >= "Link")
- for page in mysite.alllinks(prefix="Fix", limit=10):
+ for page in mysite.alllinks(prefix="Fix", limit=5):
self.assertType(page, pywikibot.Page)
self.assertEqual(page.namespace(), 0)
self.assertTrue(page.title().startswith("Fix"))
- for page in mysite.alllinks(namespace=1, limit=10):
+ for page in mysite.alllinks(namespace=1, limit=5):
self.assertType(page, pywikibot.Page)
self.assertEqual(page.namespace(), 1)
for page in mysite.alllinks(start="From", namespace=4, fromids=True,
- limit=10):
+ limit=5):
self.assertType(page, pywikibot.Page)
self.assertTrue(page.title(withNamespace=False) >= "From")
self.assertTrue(hasattr(page, "_fromid"))
+ errgen = mysite.alllinks(unique=True, fromids=True)
+ self.assertRaises(pywikibot.Error, errgen.next)
def testAllCategories(self):
"""Test the site.allcategories() method"""
@@ -352,7 +353,16 @@
self.assertTrue(len(ac) <= 10)
self.assertTrue(all(isinstance(cat, pywikibot.Category)
for cat in ac))
- # TODO: test various optional arguments to allcategories
+ for cat in mysite.allcategories(limit=5, start="Abc"):
+ self.assertType(cat, pywikibot.Category)
+ self.assertTrue(cat.title(withNamespace=False) >= "Abc")
+ for cat in mysite.allcategories(limit=5, prefix="Def"):
+ self.assertType(cat, pywikibot.Category)
+ self.assertTrue(cat.title(withNamespace=False).startswith("Def"))
+ # Bug # 15985
+## for cat in mysite.allcategories(limit=5, start="Hij", reverse=True):
+## self.assertType(cat, pywikibot.Category)
+## self.assertTrue(cat.title(withNamespace=False) <= "Hij")
def testAllUsers(self):
"""Test the site.allusers() method"""
@@ -361,9 +371,28 @@
self.assertTrue(len(au) <= 10)
for user in au:
self.assertType(user, dict)
- self.assertTrue(user.has_key("name"))
- self.assertTrue(user.has_key("editcount"))
- self.assertTrue(user.has_key("registration"))
+ self.assertTrue("name" in user)
+ self.assertTrue("editcount" in user)
+ self.assertTrue("registration" in user)
+ for user in mysite.allusers(start="B", limit=5):
+ self.assertType(user, dict)
+ self.assertTrue("name" in user)
+ self.assertTrue(user["name"] >= "B")
+ self.assertTrue("editcount" in user)
+ self.assertTrue("registration" in user)
+ for user in mysite.allusers(prefix="C", limit=5):
+ self.assertType(user, dict)
+ self.assertTrue("name" in user)
+ self.assertTrue(user["name"].startswith("C"))
+ self.assertTrue("editcount" in user)
+ self.assertTrue("registration" in user)
+ for user in mysite.allusers(prefix="D", group="sysop", limit=5):
+ self.assertType(user, dict)
+ self.assertTrue("name" in user)
+ self.assertTrue(user["name"].startswith("D"))
+ self.assertTrue("editcount" in user)
+ self.assertTrue("registration" in user)
+ self.assertTrue("groups" in user and "sysop" in user["groups"])
def testAllImages(self):
"""Test the site.allimages() method"""
@@ -404,7 +433,7 @@
le = list(mysite.logevents(limit=10))
self.assertTrue(len(le) <= 10)
- self.assertTrue(all(isinstance(entry, dict) and entry.has_key("type")
+ self.assertTrue(all(isinstance(entry, dict) and "type" in entry
for entry in le))
def testRecentchanges(self):
Revision: 5964
Author: jayvdb
Date: 2008-10-14 05:55:56 +0000 (Tue, 14 Oct 2008)
Log Message:
-----------
Default to ask when overwriting existing pages
Modified Paths:
--------------
trunk/pywikipedia/djvutext.py
Modified: trunk/pywikipedia/djvutext.py
===================================================================
--- trunk/pywikipedia/djvutext.py 2008-10-14 05:22:36 UTC (rev 5963)
+++ trunk/pywikipedia/djvutext.py 2008-10-14 05:55:56 UTC (rev 5964)
@@ -8,7 +8,8 @@
-debug If given, doesn't do any real changes, but only shows
what would have been changed.
- -ask Ask for confirmation before creating each page.
+ -ask Ask for confirmation before uploading each page.
+ (Default: ask when overwriting pages)
-index:... Name of the index page
-djvu:... Filename of the djvu file
-pages:<start>-<end> Page range to upload; <end> is optional
@@ -151,18 +152,25 @@
text = text.replace('', "\n")
# only save if something was changed
- if (not exists and text) or text != page.get():
+ # automatically ask if overwriting an existing page
+ old_text = ''
+ ask = self.ask
+ if exists:
+ ask = 'y'
+ old_text = page.get()
+
+ if not exists or text != old_text:
# Show the title of the page we're working on.
# Highlight the title in purple.
wikipedia.output(u"\n\n>>> \03{lightpurple}%s\03{default} <<<" % page.title())
# show what was changed
if exists:
- wikipedia.showDiff(page.get(), text)
+ wikipedia.showDiff(old_text, text)
else:
wikipedia.output(text)
if not self.debug:
choice = 'y'
- if self.ask:
+ if ask:
choice = wikipedia.inputChoice(u'Do you want to accept these changes?', ['Yes', 'No'], ['y', 'N'], 'N')
if choice == 'y':
try: