Search code examples
mercurialcontinuous-integration

Temporary blocking for push to mercurial repository


I am trying to automate a ci process: some files commits by ci-script to hg repo assets on remote Server. The question is how to prevent push to repo assets for all user during my ci process? Otherwise two heads will be created and ci-script will not be able to push.

  1. ci-script: pullup repo to branch B
  2. user: commit to branch B
  3. user: push
  4. ci-script commit to branch B
  5. ci-script can't push because of two heads with name B.

I have an idea: create temporary lock-file on the Server during ci-process and check its existence on prepush hook (it's probably a preoutgoing). But this solution requires an access for each repo user to the Server. Also all users must have correct prepush hooks.

Any ideas?


Solution

  • This problem was solved partially by automatic rebase in ci-script.