Allow kicking the SVN observer from an HTTP entry point.
For now just uses a hard-coded SVN URL, and never stores the last-seen revision. As a result, it always examines all revisions.
This commit is contained in:
@@ -1,9 +1,32 @@
|
|||||||
|
import logging
|
||||||
|
|
||||||
from flask import Blueprint
|
from flask import Blueprint
|
||||||
from pillar.api.utils import jsonify
|
from pillar.api.utils import jsonify
|
||||||
|
|
||||||
blueprint = Blueprint('attract', __name__)
|
blueprint = Blueprint('attract', __name__)
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@blueprint.route('/jemoeder')
|
@blueprint.route('/jemoeder')
|
||||||
def jemoeder():
|
def jemoeder():
|
||||||
return jsonify({'je': 'moeder'})
|
return jsonify({'je': 'moeder'})
|
||||||
|
|
||||||
|
|
||||||
|
@blueprint.route('/subversion/kick')
|
||||||
|
def subversion_kick():
|
||||||
|
from . import subversion
|
||||||
|
|
||||||
|
# TODO: each project should have its own SVN server.
|
||||||
|
svn_server_url = 'svn://localhost/agent327'
|
||||||
|
log.info('Re-examining SVN server %s', svn_server_url)
|
||||||
|
client = subversion.obtain(svn_server_url)
|
||||||
|
|
||||||
|
# TODO: last_seen_revision should be stored, probably at the project level.
|
||||||
|
last_seen_revision = 0
|
||||||
|
observer = subversion.CommitLogObserver(client, last_seen_revision=last_seen_revision)
|
||||||
|
observer.fetch_and_observe()
|
||||||
|
|
||||||
|
return jsonify({
|
||||||
|
'previous_last_seen_revision': last_seen_revision,
|
||||||
|
'last_seen_revision': observer.last_seen_revision,
|
||||||
|
})
|
||||||
|
Reference in New Issue
Block a user