Prevent pull of a branch using a hook - mercurial

There is a repository which must be protected from accepting a specific set of named branches coming from other repositories. How can this be accomplished using hooks?
It seems possible by using pretxnchangegroup hook, but:
(1) how to determine incoming branch name, and
(2) how to actually abort the operation? Is it possible to abort it before data is transmitted over network to the repository, i.e. only information about what is incoming is sent, but not the files?

Related

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.
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.
Clone the repository and then run your process against the cloned repo.

How can I restrict commits to a specific branch in Mercurial?

I'm essentially seeking for a way to manage write permissions to specific branches.
This can be either before committing (local), or after committing but before pushing (remote).
I need to protect certain branches from being written to in order to enforce a workflow where the release branch can only be edited by some.
Enabled and properly configured ACL Extension can be an answer in your case
ACL Extension would do it
regarding branches however:
You cannot limit read access to a subset of a repository with a read rule and a file condition: any user who has access to a repository can read all of it and its full history. 
But you can disallow push.

Splitting a mercurial commit with renames and edits into two commits (first rename, then edit)

Is there a way I can modify the history in mercurial in order to split one commit into two separate commits?
The first of these should contain just renames/moves and the second should contain the edits. This would help with interoperability with other version control systems (e.g. perforce).
I'm hoping it's possible to automate this process with a script.
It's possible
With manual work
Using MQ extension
Fist we convert commit to MQ-patch, second - split into 2 pathes, last - qfinish patches into permanent changesets

How to sync two or more Mercurial servers?

I want to keep Mercurial servers at four different locations, and want them to be identical at any given time. Meaning, any change to any of them must be propagated to all other servers. How to do that?
You can add an action on the server with an incoming hook.
Hooks allow you to automate tasks when events happen on the repository. Whenever you get a push into the repository, you can push to your mirrors as well.
More on hooks: http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html

WebSphere MQ Queue creation

I have a queue AIS.CICSUD1.BROKER.DATA accessed by different process IDs such as BO01, BO02, BO03.
Can I create the same Queue for diferent process Id's? I tried it on WebSphere MQ Explorer but it's giving me duplicate Queue error.
My queue manager is on my local machine and I need to access the queues only from my local machine.
Please let me know
Queues must be unique on a given queue manager. All of the different types of queue (QLocal, QRemote, QAlias, QModel) share the same namespace. Typically in your situation some identifier would be added to the queue name. In this case, adding the process ID seems to be the easiest approach.