I'm trying to commit with tortoiseHq, but I'm getting the error
Abort: precommit.whitelist hook failed, and the file is right since I diff'd with the file from another repo which is working fine and they have equal binary.
What should I do to fix this problem?
The precommit hook is set only on your repo, and may not be on every repository just yet. That may explain why you have the same identical file elsewhere. Or maybe it existed before the hook was added.
Nonetheless, for the problem at hand, you have few options. Either contact your admin to see why the file is not on the whitelist, and add it to the list, or disable the hook on your repo. If you do the latter, you may still get rejected at the push, if the same hook is present there, too.
Related
In Mercurial, is there a way to find out if I'm authorized to push changes to a remote repository (without actually doing a hg push)? I simply want to verify that the settings in hgrc on the local and remote server is correct.
The only way to be really sure is to try it—and even then, if it succeeds, that just means you had permission; maybe you don't now.
That said, you can simply push to them a commit that you got from them, to see if you have all the permissions required to get that far. You will end up sending them nothing and writing nothing, but you'll test as much of that code path as you can test without actually sending them something.
I've looked up the general error message, but it always seems to come immediately after an attempt to clone the repository. I'm using hg serve if that helps shed any light on this.
C:\workspace\Project>hg clone --pull http://host:8001 client
requesting all changes
adding changesets
adding manifests
adding file changes
added 1556 changesets with 6734 changes to 2367 files (+1 heads)
updating to branch trunk
abort: error: getaddrinfo failed
As the comments you've received allude to, I think the repository you're cloning contain sub-repositories.
The error message is saying that Mercurial can't find the IP address for something (i.e. a DNS lookup has failed), but you've obviously managed to connect to the server with the initial repository on it. Sub-repositories are cloned during the update process of the parent. The fact that you're getting the error just after the updating to branch trunk message leads to the conclusion that this is your problem.
Look at the contents of .hgsub in the original repository. If it has anything in it, it will have the URLs of any sub-repositories. I suspect these URLs have been written in a way that means they aren't accessible from the machine you're trying to clone to. If possible, fix these to make them general enough to work anywhere.
That error message should really say what it was looking up and why.
What are all steps required to validate commit message with set of regular expressions?
We want to work in semi-centralized set-up so I need a solution for the developer clone (local repository) and for our central clone (global repository). I read about Mercurial Hooks but I am a little bit lost how to put all things together.
For local repository I need a way to distribute validation script across my developers. I know that hooks do not propagate when cloning so I need to a way to "enable" them in each fresh clone. It would be done as a part of our PrepareEnvironement.bat script that we run anyway on each clean clone.
To be double safe I need similar validation on my global repository. It should not be possible to push into global repository commit that are not validating. I can configure it manually - it is one time job.
I am on Windows so installing anything except TortoiseHG should not be required. It was already a fight to get Mercurial deployed. Any other dependencies are not welcomed.
You can use the Spellcheck example as a starting point. In each developer's configuration, you need to use the following hooks:
pretxnchangegroup - Runs after a group of changesets has been brought into local from another repository, but before it becomes permanent.
pretxncommit - Runs after a new changeset has been created in local, but before it becomes permanent.
For the centralized repo, I think you only need the pretxnchangegroup hook unless commits can happen on the server, too. However, you will need the Histedit extension for each of the developers if the remote repo is the one rejecting one or more of the changesets being pushed. This extension allows them to "edit" already committed changesets. I would think in most cases, the local hooks will catch the issue, but like you said, "just in case."
More details about handling events with hooks can be found in the Hg Book.
I've just recently moved a lot of my Views and Controllers into more appropriate locations and am now wanting to pull down recent changes from our central repo.
I've done a hg pull which worked fine and asked me to do a hg update to bring the changes down locally. This in turn informed me that I needed to do a hg merge however when I try this, I get a message stating that
abort: outstanding uncommitted changes
When I check this using hg status I see in the list all of the files that I've moved (so they're now deleted from their old location).
How do I tell Mercurial that I've removed these files? Do I have to go through each one of them and manually do a remove? Is this something that's possible using only the command line rather than doing it with a GUI tool?
From the command line to automatically hg rm the files you've removed you'd:
hg addremove
It's likely your GUI (you didn't say which you use) exposes that functionality too.
However, that's not what's causing your message. You have some already made local changes that mercurial does know about (unlike the removed files which it doesn't know about until you tell it), and you need a hg commit before you can merge.
I have a mercurial repository, and inside it a file that ends with '>>'. When doing a hg clone from this windows repository, I get the following error:
abort: The filename, directory name, or volume label syntax is incorrect: C:\Users\Path\To\Repos/More/Path/file>>
Is there a way to fix it? It seems to do with the '>>' being confused for a redirect, although I'm also unsure of why it switched from using \ to /.
The problem is that on Windows, a filename can't contain the > symbol. You should probably try and find the push to the repository that added the file in question and do a partial rollback to get rid of that file. Then, never name a file that way again :)
EDIT: You might try performing a pull from a Linux machine or VM if you have it, and then renaming the file without the weird characters, then commit and push back to the repository. I'm not sure if you tried that already.