not really a programming question, but I cant find anywhere else to ask it and there is bound to be someone in here using this as well.
I got the mercurial.tmbundle installed and everything seems to be working fine with the exception of "Push to default repo"
I have a default repo setup (bitbucket) and just using the command
hg push
does exactly what one would expect, but when I try to do it via Textmate it just comes up with a little progressbar and the text "Accessing Parent Repository..." and that just disappears after 1 sec.
It cannot be pushing since it has no password. I have checked and there is indeed no new commits on bitbucket.
Is there something I need to configure? If you have this working then please do tell what you did to make it work. Any suggestions would be helpfull.
As suggested by RyanWilcox, hg must be waiting for a password. Try using the following syntax and see if it works: hg push http://userid:passwd#bitbucket.org/yourhg/. If so, and you're not paranoid, you may set this as the default path in your hgrc.
EDIT: add this in your hgrc and leave your default path alone:
foo.prefix = bitbucket.org/yourhg/
foo.username = userid
foo.password = passwd
foo.schemes = http https
When you push on the command line does it ask you for a password?
Maybe it's asking for a password when you run it via the bundle and it's erroring at that point?
Maybe console.app can give you a useful log message?
Related
I have been using mercurial for a few months now and just the other day when I went to do an hg commit, my editor launched but with an empty file named something like "/tmp/hg-editor-I48e8Z.txt" and in my terminal it automatically returned an "abort: empty commit message" error.
It had been working fine and it still works fine for other users on the same machine. The only way I've been able to commit is to specify the commit message at the command line. I really don't like doing that because I like that I can double-check which files will be included in the changeset when the editor pops up.
Does anyone know what may have caused this/how to fix this?
This is on a Redhat Linux machine, Mercurial version 1.
I use gvim. With:
export EDITOR = gvim
I had the problem. Changing to:
export EDITOR = 'gvim -f'
fixed the problem.
And of course, I just found out what it was...
I was setting my EDITOR and VISUAL environment variables incorrectly.
I am trying to set up a hook to notify me about new commits via mail.
Because of the issue described in Mercurial hook not executing properly, I can't seem to get it running by simply adding the following to my .hg/hgrc, since the script wouldn't run:
[hooks]
changegroup = /path/to/script
As a workaround, I added the hook in the hgweb.config where it runs as expected. Now since I'm pushing through HTTP, the actual user running the script is apache (as determined by running id from within the hook), which means that I get errors like
Not trusting file .hg/hgrc from untrusted user u, group g
I added
[trusted]
users = u
but the same errors remain. What am I doing wrong? Am I understanding this completly wrong? Appreciate any help!
You should add both the hook and the trust blocks not in the hgweb.config but in a .hgrc file in the apache user's home directory. One doesn't usually think of system users having home directories, but they all do, and you can find in in /etc/password. It's often something like /var/www, so if you create a /var/www/.hgrc file, make sure it's owned by the Apache user, and add the hook and the trust you'll be good to go.
At home, this works perfectly. I'm on another computer now (using cygwin) and hg push will not prompt for a username / password:
user#localhost /cygdrive/d/repos/upthescala/viewprotect
$ hg push https://viewprotect.googlecode.com/hg/
pushing to https://viewprotect.googlecode.com/hg/
searching for changes
abort: http authorization required
Here are the contents of my ~/.hgrc:
[http_proxy]
host=someproxy:8080
[ui]
username = My Name <myemail>
Thanks in advance for any advice!
Note: this seems to be a cygwin problem. When I try from the Windows prompt (cmd.exe), it works as expected:
D:\repos\upthescala\viewprotect>hg push https://viewprotect.googlecode.com/hg/
pushing to https://viewprotect.googlecode.com/hg/
searching for changes
http authorization required
realm: Google Code Mercurial Repository
user: myemailaddress
password: *********
remote: Success.
--
LES
This could be caused by using a version of Mercurial that's tied to the Windows console subsystem. The binary distributed with Tortoise falls into this category. If this is the case, mercurial is expecting to use the console subsystem to prompt for credentials, but it does not find it when run from the Cygwin shell. In my case, installing and using the Cygwin version of mercurial fixed the problem, in addition to fixing color output. To check which version you're using, run 'which hg' (but you probably already knew that).
To add to Andrew's comment:
installing and using the Cygwin version of mercurial fixed the problem,
This also fixed the problem for me, but it caused another problem which took me some time to figure out. When using the Cygwin version of hg, all files that had been cloned under TortoiseHG showed up as modified when I ran hg status, but no differences were shown for any of them when I ran hg diff.
The problem was that the permissions didn't match. Running chmod 644 .* -R in each repo resolved this problem.
Since it's HTTP you can always put the username and password right in the URL. That works on any website using http auth and in any browser.
hg push https://myemailaddress:*********#viewprotect.googlecode.com/hg/
Alternately, newer Mercurial versions have an auth section you can use.
BTW, that's a terrible password. You should come up with something better than eight stars.
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Continuous Integration stack on Windows with Mercurial + Mercurial Queues?
If so, what does your build process look like?
I'm having a difficult time (mostly because of my lack of experience/understanding of all 3 tools) getting TeamCity to run my FinalBuilder scripts. Right now I have FinalBuilder managing all the source control checkouts and TeamCity basically just running the FinalBuilder script and reading in the NUnit test results, but it doesn't work due to authentication errors while executing mercurial commands to kiln.
If you've installed the Kiln Client on the machine running your FinalBuilder script, you'll have access to the "kilnauth" mercurial extension that should solve this problem for you.
Just log on to the build machine as the user that runs the FinalBuilder script and manually execute one push or pull command from the Mercurial repository you're trying to use, you'll be asked to authenticate. Authenticate once, and the Kiln Client extensions will remember this authentication for this user...and any subsequent runs by the FinalBuilder script should authenticate just fine.
Does this solve the problem for you? It's the best solution as it doesn't store any username or password on your machine. There are obviously other possibilities, like changing the path of your Mercurial to use the format http://{username}:{password}#{kiln url}...but this isn't as nice or safe as the technique above.
Does this make sense?
I don't know anything about Kiln, but I've just started working for VSoft and am working on a Mercurial action for the next version of FinalBuilder. Hopefully some of this will help.
Are you athenticating via SSH or SSL? Can you pull/push to the repository from the command line? Pretty much anything you can get to work from the command line should be possible with FinalBuilder.
To authenticate to BitBucket via SSH, I did the following:
download puttygen and pageant
create a new SSH key in puttygen
add the private key to pageant
add the public key to BitBucket
From there, I can successfully
hg push ssh://hg#bitbucket.org/user/repo
NB, I also have TortoiseHG installed, and Mercurial is using TortoisePlink as the ssh client.
If you're using SSL, you can store the username/password combo in your FinalBuilder action. To turn a TextEdit box into a password field, change the PasswordChar property from #0 to *. Then in the ReadData event, add something like
Page.tbPassword.Text = DecryptString(Properties.PropertyAsString("Token"));
and in the WriteData event, add
Properties.PropertyAsString("Token") = EncryptString(Page.tbPassword.Text);
When you add the Token property to your action, tick the Property is Hidden from Action Inspector and Property is Read Only in Action Inspector options.
To generate your repository string, you'll want to do something like this in the Action's GetCommandLine event:
var repo = Context.Properties.PropertyAsString("Repository");
var username = Context.Properties.PropertyAsString("Username");
var password = DecryptString(Context.Properties.PropertyAsString("Token"));
var repo = "ssh://" + username + ":" + password + "#" + repo;
CommandLine.AddArgument("push", repo, qtNone);
NB, I haven't tested that code, but hopefully it gives you an idea.
This is probably a simple problem and I'm feeling exceptionally dumb because I can't find a any kind of documentation.
I've just installed TeamCity 5 and I want to get files from my Mercurial hosting and there is two fields I just can't figure out.
HG Command path. What should I put here? The path to a file containing what? Can I get an example of that file somewhere?
The host is using Mercurial over SSH where do I define my private key?
Pull changes from? Should I put the address I'm cloning from i.e. ssh://username#myhost.something/project
I figured this out for my TeamCity 5 server last week.
HG Command path: HG
Pull changes from: https://bitbucket.org/.../.../
Don't put the username# in the URL. This is specificed as in the Username/Password fields. If you include the username in the URL it'll fail as there is a bug in the configuration tool. You'll also see a screenshot of the configuration attached to the thread:
http://www.jetbrains.net/devnet/message/5254640#5254640
I'd suggest getting things working with HTTPS and then moving to SSH if possible. This breaks things down into two easier to solve configuration problems. I used the following tutorial to get SSH going on my Windows client machine.
http://www.codza.com/mercurial-with-ssh-setup-on-windows
I've not set this up on my TeamCity server yet. However I did get TeamCity to pick up my Mercurial.ini settings by putting the ini file in \Documents and Settings\TeamCity, which is the account the service runs under.
I've not used team city, but I think hg command path is probably the full path to your local mercurial executable. For me (on linux) that's:
$ type hg
hg is /usr/bin/hg
On windows it's where the 'hg' executable in your system path was placed by whichever (of the many) windows installers for mercurial you used.
Pull changes from sounds like the URL to the repo, so:
ssh://username#myhost.something/project
or
ssh://username#myhost.something//project # note the _two_ double slashes
if you're using absolute paths on the server side.
Your private key location/specification depends on what you're using for ssh and whether or not you're running ssh-agent, but here's a links that explicitly points from within mercurial.ini, which seems sound:
http://dev.openttdcoop.org/projects/home/wiki/Configuring_TortoiseHg_(Windows)#Pointing-to-you-Private-key