Eldad Assis
Eldad Assis

Reputation: 11045

Mercurial - a simple way to lock a repository

My scenario:
A set of shared repositories needs to be locked for a given time so a process can run for a given time. After this process is done, I want to unlock the repositories. It's a process not on the repositories, but on a different system.

The repositories are not what the process is working on. I just need a time frame where the repositories are "protected". I just need to make sure the repositories don't change while this process is running.

I want a simple way to lock a repository, so no one can push to it.
If I manually create a .hg/store/lock file with a dummy content, do you see any problem with it?

Initial testing shows it works, but I'm concerned that I might not be aware of the implications.

Upvotes: 2

Views: 249

Answers (2)

Thomas Weller
Thomas Weller

Reputation: 11717

If you just need to generally deny access to the repos for a given period, then you can do it that way. There shouldn't be any side-effects or other consequences.

Upvotes: 2

Deadron
Deadron

Reputation: 5289

Clone the repository and then run your process against the cloned repo.

Upvotes: 1

Related Questions