I've installed Mercurial per MT's knowledge base file here.
Working with it server side using ssh from my Mac works fine. I can initialize repositories and the like, but pulling from the server or pushing from my Mac produces an error I don't understand.
Here's what I get when call hg push from my local installation (hash marks represent my server number):
remote: Traceback (most recent call last):
remote: File "/home/#####/users/.home/data/mercurial-1.5/hg", line 27, in ?
remote: mercurial.dispatch.run()
remote: File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/dispatch.py", line 16, in run
remote: sys.exit(dispatch(sys.argv[1:]))
remote: File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/dispatch.py", line 21, in dispatch
remote: u = _ui.ui()
remote: File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/ui.py", line 38, in __init__
remote: for f in util.rcpath():
remote: File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/util.py", line 1200, in rcpath
remote: _rcpath = os_rcpath()
remote: File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/util.py", line 1174, in os_rcpath
remote: path = system_rcpath()
remote: File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/posix.py", line 41, in system_rcpath
remote: path.extend(rcfiles(os.path.dirname(sys.argv[0]) +
remote: File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/posix.py", line 30, in rcfiles
remote: rcs.extend([os.path.join(rcdir, f)
remote: File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/demandimport.py", line 75, in __getattribute__
remote: self._load()
remote: File "/nfs/c05/h01/mnt/#####/data/mercurial-1.5/mercurial/demandimport.py", line 47, in _load
remote: mod = _origimport(head, globals, locals)
remote: ImportError: No module named osutil
abort: no suitable response from remote hg!
Mercurial on my Mac is configured as follows
[ui]
username = John Smith
editor = te -w
remotecmd = ~/data/mercurial-1.5/hg
My local single repo is configured as follows (hash marks represent my server number):
[paths]
default = ssh://mysite.com#s#####.gridserver.com/domains/mysite.com/html
Mercurial on the server is configured with a just a username:
[ui]
username = John Smith
The server .bash_profile is configured as follows (per the installation guide):
# Added this as suggested by the MediaTemple guide
export PYTHONPATH=${HOME}/lib/python:$PYTHONPATH
export PATH=${HOME}/bin:$PATH
I understand this probably isn't a MediaTemple problem, but more likely an installation problem. I would really appreciate any assitance on this. Thanks in advance!
Your mercurial installation isn't complete, you didn't compile the osutil module (there should be a osutil.so somewhere).
#tonfa,
hgdebuginstall produced no errors, which is why the problem I was having was so weird.
Thanks to your response, I did some digging and found the module in ~/lib/python/mercurial, so I copied the osutil.so file over to my ~data/mercurial-1.5/mercurial directory and that was that... but then more and more modules couldn’t be found so I decided to copy the entire contents of one directory over to the other, like so:
$ rm -R ~/data/mercurial-1.5/mercurial/*
$ cp -r ~/lib/python/mercurial/* ~/data/mercurial-1.5/mercurial
Now, everything works fine. I don't understand why it seems that mercurial was installed in two directories, or why one directory (~/data/mercurial-1.5/mercurial) didn't get the same files as the other (~/lib/python/mercurial).
Anyway, this is the solution I came up with. If you (or anyone) can think of something more elegant, I'd be all ears, but as it is... this one works for me.
Thanks for your time.
Related
We are using mercural-server for the central repository on a server and windows developers use TortoiseHg as a client. One of developers can't even clone the repository -- hg responses with "abort:" with no message.
SSH authorization is passed successfully -- using the same key on other computer is OK and i can clone the repository and make changes in it.
If i run hg --traceback clone <...> on that developer's computer i get:
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 88, in _runcatch
File "mercurial\dispatch.pyo", line 743, in _dispatch
File "mercurial\dispatch.pyo", line 514, in runcommand
File "mercurial\dispatch.pyo", line 833, in _runcommand
File "mercurial\dispatch.pyo", line 804, in checkargs
File "mercurial\dispatch.pyo", line 740, in <lambda>
File "mercurial\util.pyo", line 475, in check
File "mercurial\commands.pyo", line 1234, in clone
File "mercurial\hg.pyo", line 267, in clone
File "mercurial\hg.pyo", line 121, in peer
File "mercurial\hg.pyo", line 101, in _peerorrepo
File "mercurial\sshpeer.pyo", line 59, in __init__
File "mercurial\sshpeer.pyo", line 73, in validate_repo
File "mercurial\util.pyo", line 137, in popen3
File "subprocess.pyo", line 679, in __init__
File "subprocess.pyo", line 896, in _execute_child
WindowsError: [Error 2]
abort:
The destination folder is writable. I don't even know what can be a source of a problem, because the same version of TortoiseHg (TortoiseHg 2.7.1 (with Mercurial 2.5.2)) on other windows computer and with the same repository works fine.
In this situation, you should go to the source - hg clone https://www.mercurial-scm.org/repo/hg. Looking at sshpeer.py line 73 and the context around it, it appears the error is occurring when trying to execute the ssh call.
The most likely causes are:
The developer has a messed-up ui.ssh entry in an hgrc somewhere. Possibly they've specified like:
[ui]
ssh = "ssh -C"
instead of:
[ui]
ssh = ssh -C
The developer may have specified a ui.ssh section without having appropriate ssh binaries available. By default, TortoiseHg will use PuTTY (it installs the binaries) but Mercurial will obey if you say to use something else.
If checking the above doesn't help, clone the mercurial source, modify it to display the ssh command (sshpeer ~line 73) and install it in pure mode, then try to clone. This will tell you exactly what is being called.
hg clone https://www.mercurial-scm.org/repo/hg
cd hg
<path\to\python>\python setup.py --pure install
cd <other directory>
<path\to\python>\Scripts\hg.bat clone <repo>
Also, please raise a bug report at the appropriate bug tracker.
I am getting the next error:
java]Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\jobs\test1\workspace
$ hg clone --rev default --noupdate ssh://locahost/*/test1 "C:\Program Files (x86)\Jenkins\jobs\test1\workspace"
remote: Unable to open connection:
remote: Host does not existabort: no suitable response from remote hg!
ERROR: Failed to clone ssh://locahost/*/test1
ERROR: Failed to clone ssh://locahost/*/test1
Finished: FAILURE
In mercurial pluging from the jenkins console I have used
Repository URL: ssh://locahost/*/test1
The rest options are in default
Any idea?
Thanks
I don't know why you have a * character in your path to the remote repository, but that seems likely to be the culprit for this particular error (it generates similar errors against my own hg server).
Hosting Mercurial on a windows box thru IIS.
I have a root directory where I put all of my repos
d:\repos
- ProjectA
- .hg
- hgrc
- ProjectB
- .hg
- hgrc
- ProjectC
- .hg
- hgrc
All of the repos' hgrc files setup the notify extension with:
config =d:\hg\Repositories\NotificationList.txt
That way I have a single file to manage all of the notification recipients, like the wiki describes:
https://www.mercurial-scm.org/wiki/NotifyExtension
But the wiki makes mention of controlling that NotificationList.txt file thru it's own repository? How can I do that? If I create a separate repo at d:\repos\HgNotify and have the NotificationList.txt file in there, users can change, commit and push back, but when the push occurs, NotificationList.txt does not get updated on the hg server.
Is there a way to update that file somehow? Am I missing a key setup on my Hg server? Or do I need to use a post-push hook to deploy that file?
Update 1
I added the details from Tim's answer and I kept getting HTTP 500: Server Error on the push. I finally figure out how to trace the python calls (python -m win32traceutil), and here is what seems to be the problem:
File "C:\Python27\lib\site-packages\mercurial\util.py", line 402, in hgexecutable
exe = findexe('hg') or os.path.basename(sys.argv[0]) AttributeError: 'module' object has no attribute 'argv'
It doesn't seem to be able to find hg.exe.
Update 2
I installed TortoiseHg and rebooted the system. Now I get:
emote: added 1 changesets with 1 changes to 1 files
remote: notify: sending 1 subscribers 1 changes
remote: warning: changegroup.update hook exited with status 1
So that makes be think that it has found the hg.exe, but it is not doing its job, because the file does not get updated
Update 3
Found my solution here: https://stackoverflow.com/a/8023594/698
The command line I ended up using was:
changegroup = cmd /c hg update
I also added:
[ui]
debug=true
To my hgrc. Those two combined gave me a lot more meaningful messages. In the end I saw "Access denied". I gave Users full permission, but I am not sure why giving IUSR full permission didn't work. Something I'll have to dig into at a later time.
On the server repo containing your notification list you need to add a changegroup hook:
[hooks]
changegroup.update = hg update -C
or if you want to ensure the repository is always clean:
[extensions]
purge =
[hooks]
changegroup.update = hg update -C && hg purge --all
I'm trying to get the hggit extension to work under Windows 7 (64bit) using TortoiseHG (2.1.2). I followed the official setup instructions, i.e. cloning the hg-git repository and adding the "hggit = ..." line to the extensions section in my mercurial.ini file.
However the extension doesn't seem to be loaded. When trying to clone a repository I get the following error :
abort: repository git://... not found!
running
hg help hggit
results in
hg: unknown command 'hggit'
I also don't get any errors at all, no matter what I put in the extensions section of the mercurial.ini file.
Any ideas on what the problem might be ? Are there any log files at all that show me whether there are problems loading the extensions ?
Had the same problem, and in my case I forgot to specify the [extensions] line in the INI file.
Not working:
[ui]
username = My name <my#emailaddress.com>
hgsubversion=D:\Repotools\hg-svn\hgsubversion
hggit=D:\Repotools\hg-git\hggit
Working:
[ui]
username = My name <my#emailaddress.com>
[extensions]
hgsubversion=D:\Repotools\hg-svn\hgsubversion
hggit=D:\Repotools\hg-git\hggit
When you run the command hg help hggit it will report if the directory path is incorrect.
You should include what you have after hggit =
It should be pointing to the hggit subdirectory in the directory you cloned the repository into.
e.g. hggit=C:\hg-extensions\hg-git\hggit
I just picked up TortoiseHg to use for distributed source control on Windows and installed it on my C drive. Then I created a repository (located in D:\projects).
When I try to commit the changes, it gives me the error
"abort: None: The system cannot find
the file specified"
in a new window titled "Commit". This causes the commit to abort. It doesn't specify any file, and when I run hg --traceback commit -m 'Message' it gives this as output:
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 54, in _runcatch
File "mercurial\dispatch.pyo", line 483, in _dispatch
File "mercurial\dispatch.pyo", line 351, in runcommand
File "mercurial\dispatch.pyo", line 534, in _runcommand
File "mercurial\dispatch.pyo", line 488, in checkargs
File "mercurial\dispatch.pyo", line 481, in <lambda>
File "mercurial\util.pyo", line 420, in check
File "mercurial\commands.pyo", line 762, in commit
File "mercurial\cmdutil.pyo", line 1202, in commit
File "mercurial\commands.pyo", line 757, in commitfunc
File "mercurial\localrepo.pyo", line 816, in commit
File "mercurial\localrepo.pyo", line 1053, in status
File "mercurial\dirstate.pyo", line 629, in status
File "mercurial\dirstate.pyo", line 540, in walk
File "mercurial\localrepo.pyo", line 796, in fail
Abort: Adding: The system cannot find the file specified
abort: Adding: The system cannot find the file specified
I don't know what else I can give as debug info, not having any experience with the program.
I have configured TortoiseHg with both a username globally and for the repository. Also, kdiff3 is specified as both the three-way merge tool and the visual diff tool. I have not knowingly changed any other settings.
Thanks for any help, and please ask for more information, I just don't know what to give in this situation.
I'm getting acquainted with Hg and trying Tortoise-Hg out and I'm running to the same exact issue as the OP. I cloned a repository
from one of the open source projects and made some changes to the source.
However when I attempt to commit, I get the follow message from the commit
dialog window:
abort: None: The system cannot find the file specified
Dropping down to commandline and using hg commit -m "message" works. I'm
using this under Windows 7 64-bit and have tried two versions TortoiseHg 1.1.5 and
the latest 1.1.6.1(64-bit version) as of this post.
Any idea what the problem is? As you can imagine, this is a major issue since I can't even do one of the most basic operations for a version control system w/o needing to drop down to CLI. What is wrong with this?
Thanks
Update: I have SOLVED the issue! After some collaboration on the TortoiseHg mailing-list, I've identified the root cause of this error. This error is happening because whenever tortoisehg tries to commit it's tacking on an extra 'none' parameter to the end of that commit command line.
This can happen if you've set your repository settings->Commit->Auto Commit List to 'None'. The fix is simple -- make sure that Auto Commit List and Auto Exclude List are both set to < unspecified >. Check your global settings as well and make sure these 2 fields are set the same way.
Additionally, to see if your Auto Commit List and Auto Exclude List are set properly type
hg showconfig --debug tortoisehg
If it contains a line something to this effect:
mercurial.ini:15: tortoisehg.autoinc=None
then tortoisehg isn't configured properly.
I hope this solves the issue for the OP and others that are running into this problem and pulling their hair out trying to fix it.
Try this:
Remove TortoiseHG
Restart the system (basically to make sure there are no processes from tortoise, such as file monitoring, that can put locks on files)
Intall command line hg
do the regular hg commit -m "yourmessage"
If this works, it's more likely than not that the monitoring tool from TortoiseHg is holding a lock on some file (the system tray applet).
It also could be the case that someone else is doing than (not TortoiseHg), e.g. editor? diff tool? etc?
Finally, another reason why this can happen is: someone fooled around with the repo files inside .hg directory... It doesn't seem to be the case though