summaryrefslogtreecommitdiff
path: root/morph-cache-server
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-09-05 17:49:21 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2012-09-07 13:35:30 +0100
commit2c04007fc74d5971b12f351a4c2076e403386997 (patch)
tree208ff1cccbf752657329fd2975a797093f9dae18 /morph-cache-server
parentcd00de30a0f4d2d422053692948ea9986960c43f (diff)
downloadmorph-cache-server-2c04007fc74d5971b12f351a4c2076e403386997.tar.gz
Return tree SHA1 when looking for ref resolution.
Morph now expects the tree SHA1 in addition when resolving references using the cache server. This is to better facilitate correct cache key computation since commits can be made which have no tree changes and thus nothing to usefully affect the build. (For example the morph branch and build features)
Diffstat (limited to 'morph-cache-server')
-rwxr-xr-xmorph-cache-server5
1 files changed, 3 insertions, 2 deletions
diff --git a/morph-cache-server b/morph-cache-server
index bb84915..3a121d4 100755
--- a/morph-cache-server
+++ b/morph-cache-server
@@ -65,11 +65,12 @@ class MorphCacheServer(cliapp.Application):
ref = self._unescape_parameter(request.query.ref)
try:
response.set_header('Cache-Control', 'no-cache')
- sha1 = repo_cache.resolve_ref(repo, ref)
+ sha1, tree = repo_cache.resolve_ref(repo, ref)
return {
'repo': '%s' % repo,
'ref': '%s' % ref,
- 'sha1': '%s' % sha1
+ 'sha1': '%s' % sha1,
+ 'tree': '%s' % tree
}
except Exception, e:
response.status = 404