"hg" directory location on Hostgator Mercurial Installation - mercurial

I am following the directions here trying to get Mercurial running on my shared HostGator account.
I am supposed to create a "hg" directory, but I am unsure if it is to be in the /home/user/ location or in /home/user/domain-I-want-to-version-control/. I actually tried creating that directory, and the modified 'index.cgi' inside. When I then navigate to (url)/hg I get an internal server error.
Could really use some guidance, please.

Never create repository this way! If you want to add Mercurial repo for existing code (did you try to verify, that you have working hg?!) read before it QuickStart Guide at least

Related

Using Mercurial extension

I have recently started using Mercurial and in the extensions list provided by TortoiseHg Workbench I found an extension called Simplelock. I am unsure on how to use this. As in I find it necessary for my project but I am unable to use this since whenever I try to click Lock Repository it gives me the error: Operation aborted: No lock repository configured.
This is probably my in-expertise talking but would someone tell me how to work around this and to use this?
Thanks!!
Have you configured the lock repository?
Initialize an empty repo where everyone on your team can access it. Everyone should clone the lock repo locally and configure their global hgrc or Mercurial.ini file with the location of the lock repo.
[simplelock]
repo = ~/work/locks

Cannot clone Mercurial repository

I'm having difficulty cloning a repository in Mercurial.
The repository is stored at Kiln on demand, though I'm not sure that makes much difference.
I have a new install of Tortoise HG, which has of course installed the hg command line onto my machine.
When I attempt to clone the repository, I immediately receive the error:
abort: The system cannot find the path specified: 'F:\backups\_hgcookies'
Code: 255
I don't know where it's getting this path from - there is an 'F' drive on my machine that is completely empty aside from hidden system volume files.
The Kiln Tortoise install contains a couple of plugins bundled with it, including kilnauth, which I assume is using a cookie to store authentication information.
I've looked in the mercurial.ini file, however it contains no mention of this folder or hgcookies - that I can see.
I'm wondering if there's a permissions issue somewhere - I'm in the administrators group on the machine, but am on a company network with quite a bit of lockdown which has caused problems before.
I've not found any similar problems through googling, though it's been difficult to get relevent results with the word 'backup' and 'hgcookies' in my terms!
Any help, greatly appreciated.
Seems this was an issue with the KilnAuth extension. I'm not sure why it decided to store the cookies on the F: drive, but I manually created a 'backups' folder on that drive and that allowed it to store the cookie there with no problems.
I had some help from the FogCreek guys diagnosing this - I have to say I've never experienced such awesome customer service, really. Hats off to those guys!

Adding an external project directory in phpStorm 6.0 to keeping workspace files separated from code?

I am try to keep separate workspace directory and code directories in my php project and sweating to understand/find how this could be achieved. A couple of revisions back I tried phpStorm and found that it does not provide such feature.
I just want to know if phpstorm 6.0 has this feature or still lacking it ? If possible please help me out.
Work Around
File > Settings >[Directories]
+[Add Content Root] to add external directory
Assuming that you have created project separate from code.Some of the tool might not work
as expected
This works for linux using sshfs, sorry for windows users.
I've created this folder structure in my pc
/mnt/remote_code/code/
And i have to mount code from server like this
sshfs user#server:/var/www/server_code/ /mnt/remote_code/code/
Code from server will be mounted in code folder
In PS I open this directory: /mnt/remote_code/
So, that means PS will create this folder /mnt/remote_code/.idea (indexing and saving all project and ide settings), and keeps the code folder (with remote code inside) without changes.
Hope it help you.
Greetings.

Get changes from mercurial to FTP site

I work with a partner on an PHP site for a client. We have a common Mercurial repository (on Bitbucket), both local copies and the live site. We have only FTP access to the live site (which can't be changed since it is a hosting package with FTP only).
I want to be able to push changes from the repository to the live site.
Until now I simply keep track of changed files in the repo and copy them manually with FileZilla - a error prone and annoying task. My idea is, to mount the remote location locally (i.e. using CurlFtpFS) and tell mercurial to automagically copy changed files to the site. Ideally I want to be able to specify which changes but this would be a bonus. It would be sufficient if the local state of the files within the repo are synced.
Is there any good way to do this using linux commandline tools?
My first recommendation is, if at all possible, get a package that allows more access. FTP only is just brutal.
But since you are looking for a real answer to your question, I have two ideas for you:
I would suggest looking into the mercurial FTP Extension. I personally have never used it since I have never gotten myself stuck in a ftp-only situation (not for a long time at least), but it looks promising. Looks like if you make sure that you tag your production releases it will work really well for you. (make sure to use the -uploaded param)
Also, if you only ever want the tip to be installed on your production env, then you could look at the suggestion Martin Geisler made on the bitbucket user group a few days ago. Basically his suggestion is to utilize bitbucket's "ping url" functionality. You would have to write a server-side script/url handler that would accept that ping, then fetch the tip from bitbucket (as a zip) and then unzip/unpack it. This is a bit complicated, but if you are looking for complete automation and the tip will always be the best this could work for you.
One notion is the use the hg archive command:
hg archive /path/to/curlftpsfs
which will put a snapshot of your repo in that location -- it will however overwrite any file already there.
Another option is to create a Mercurial clone in that same /path/to/curlftpsfs and then just do a hg pull ; hg update in it on your local system with the remote one mounted. Setting that up initially will mean transferring the whole thing but subsequently you'll only be sending deltas.
Some folks don't like this last options because it exposes your entire /.hg repository too, but you can block access to that at the web server.
I came across this problem a while ago after switching from AWS to a local web hosting that provides only ssh/ftp.
My previous approach of updating a production site on AWS using "hg pull; hg update -C" can no longer be used on the new web hosting. They don't have mercurial installed for shared hosts.
So, what I did is to mount the remote location using ftp, to a local machine (i.e. your laptop), then run the hg pull and update commands locally on your machine at the path where has the remote ftp site mounted.
Windows solution:
BeyondCompare (http://www.scootersoftware.com/) is an awesome piece of software. Apart from being awesome it can mirror your local folder to the FTP site. It's comparing files and only transfers what's new.

How to configure hosted Mercurial in TeamCity 5

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