Implement Git LFS 2.0 locking

This patch introduces persistency to Git LFS 2.0 locking. Lock is
represented by the following JSON object:
  {
     "id":"lock_id",
     "path":"IMG_1226.PNG.jpg",
     "locked_at":"2017-05-05T14:40:44.683Z",
     "owner":{
        "name":"admin"
     }
  }

and is stored under plugin data directory:
$GERRIT_SITE/data/lfs/lfs_locks/{project}/ as regular file with "id"
used as filename.

Design decisions:
LFS locks are kept in 2 levels caches. First level contains project to
locks mapping and is loaded on first request to lock API for given
project. Second level contains lock id to lock data (path, owner, etc.)
mapping that is backed up by lock id named file (mentioned above).

Change-Id: I434fe7de9f5b2561167e38d6518feb91a03b747d
Signed-off-by: Jacek Centkowski <jcentkowski@collab.net>
11 files changed
tree: 6a95fe8058f1486b0a7c55c0339fe36e9275ec31
  1. src/
  2. tools/
  3. .gitignore
  4. bazlets.bzl
  5. BUILD
  6. external_plugin_deps.bzl
  7. WORKSPACE