• Georges Racinet's avatar
    Forwarding actual permissions to Mercurial processes · 4c45dfe84231
    Georges Racinet authored
    Closes #334
    Normally, the abstraction layers in GitLab mean that the Project
    should not be accessible from the low level repository. However,
    we need it to pass it down to the `hg` processes. Doing it in
    `hg_env_for_write` is the way to make it really robust, since all
    write operations basically have to use it.
    To mitigate somewhat this breach of abstraction, we make the
    attribute writable only, and we give it a more specific name than
    just '@project'. Aesthetically, it would be better to store only
    a factory for the `UserAccess` instance that we really need, but
    that could be done separately.
    This required running some of `HgAccess` RSpec tests with empty
    repositories, because in them, the project owner does not have enough
    rights to create a first commit any more, and there's not even
    an admin user around for that.
    branch : heptapod