Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(989)

Unified Diff: chrome/common/extensions/docs/server2/handler.py

Issue 736773002: Docserver: Add commit history and _reset_commit servlet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/docs/server2/app.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/handler.py
diff --git a/chrome/common/extensions/docs/server2/handler.py b/chrome/common/extensions/docs/server2/handler.py
index a0e044e753aab96ad34bc124736999020b42f372..5b02a392a5336986c02030aead62210501229df2 100644
--- a/chrome/common/extensions/docs/server2/handler.py
+++ b/chrome/common/extensions/docs/server2/handler.py
@@ -60,12 +60,31 @@ class _QueryCommitServlet(Servlet):
return Response.Ok(commit_tracker.Get(self._request.path).Get())
+class _ResetCommitServlet(Servlet):
+ '''Writes a new commit ID to the commit cache. For example:
+
+ /_reset_commit/master/123456
+
+ will reset the 'master' commit ID to '123456'.
+ '''
+ def __init__(self, request):
+ Servlet.__init__(self, request)
+
+ def Get(self):
+ object_store_creator = ObjectStoreCreator(start_empty=False)
+ commit_tracker = CommitTracker(object_store_creator)
+ commit_name, commit_id = self._request.path.split('/')
not at google - send to devlin 2014/11/18 23:05:48 Is there some kind of validation that you can do o
+ commit_tracker.Set(commit_name, commit_id).Get()
+ return Response.Ok('Done.')
+
+
_SERVLETS = {
'cron': CronServlet,
'enqueue': _EnqueueServlet,
'patch': PatchServlet,
'query_commit': _QueryCommitServlet,
'refresh': RefreshServlet,
+ 'reset_commit': _ResetCommitServlet,
'test': TestServlet,
}
« no previous file with comments | « chrome/common/extensions/docs/server2/app.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698