anchor.diff:  
   %% Records used as table entries
   
  --record(lease, { r_id :: binary()   % repo identifier
  -               , s_path :: binary() % repo subpath which is locked
  -               , u_id :: binary()   % user identifier
  -               , l_id :: binary()   % lease identifier
  -               , time :: integer()  % timestamp (time when lease acquired)
  +-record(lease, { s_path :: {binary(), binary()} % repo + subpath which is locked
  +               , u_id   :: binary()  % user identifier
  +               , time   :: integer()  % timestamp (time when lease acquired)
                  }).
  +
  +-record(state, { max_lease_time :: integer() }).
   
   %%%===================================================================
   %%% API
  
positive.code: start_link(Args) ->
      gen_server:start_link({local, ?SERVER}, ?MODULE, Args, []).
  
  stop() ->
      gen_server:cast(?MODULE, stop).
  
  
  %%%===================================================================
  %%% gen_server callbacks
  
negative.code: %%%===================================================================
  %%% Internal functions
  %%%===================================================================
  
  priv_new_lease(User, Repo, Path, State) ->
      #state{max_lease_time = MaxLeaseTime} = State,
      T = fun() ->
                  case mnesia:read(lease, {Repo, Path}) of
                      [] ->
                          mnesia:write(#lease{s_path = {Repo, Path},
                                              u_id = User,
                                              time = erlang:monotonic_time(seconds)});
                      [#lease{time = Time} | _] ->
                          {busy, MaxLeaseTime - (erlang:monotonic_time(seconds) - Time)}
                  end
          end,
      Result = mnesia:transaction(T),
      lager:info("Result: ~p", [Result]),
      {ok, Result}.
  
  priv_end_lease(_Repo, _Path) ->
      ok.
  