Update Agito configuration to deal with new branch URLs.

Subversion-branch: /git
Subversion-revision: 2624
This commit is contained in:
Simon Howard 2013-08-24 04:50:46 +00:00
parent abcd43a3e0
commit 51a15de176

View file

@ -1,6 +1,7 @@
import re
SVN_REPO_URL_RE = re.compile('http.*/svnroot/chocolate-doom(.*)')
SVN_REPO_URL2_RE = re.compile('svn.*/p/chocolate-doom/code(.*)')
# URL of the Subversion repository.
@ -35,7 +36,7 @@ AUTHORS = {
DEFAULT_AUTHOR = ("%", "%@users.sourceforge.net")
FILTER_REVISIONS = [ 5, 391, 392, 1027, 2528 ]
FILTER_REVISIONS = [ 5, 391, 392, 1027, 2528, 2622 ]
# Callback function to invoke before creating each commit. This is similar
# to git's 'filter-branch' command. Invoked with the branch path, log entry
@ -150,9 +151,21 @@ def branch_helper_callback(path, entry, changed):
parent_url = agito.propget(path, entry.revision.number - 1,
'branch_helper:parent_url')
# Try both URL patterns.
match = SVN_REPO_URL_RE.match(parent_url)
assert match
return (match.group(1), after)
if not match:
match = SVN_REPO_URL2_RE.match(parent_url)
if match:
parent_path = match.group(1)
else:
# If neither patteerns match, it may be a "modern"
# repository-relative path, but it must begin with /
assert parent_url.startswith('/')
parent_path = parent_url.strip()
return (parent_path, after)
MERGE_CALLBACKS = {
"branch_helper:last_merged": branch_helper_callback