I updated my Ubuntu installation which updated my mercurial version, and now hgsubversion doesn't work anymore. I keep getting an error that says "abort: No module named repo!" My copy of hgsubversion seems to be up to date with http://hg.durin42.com/hgsubversion/.
hgsubversion doesn't seem to be actively maintained, but the error wasn't too hard to fix. Taking a look at the relevant source file shows that this error isn't the real error, but is from attempting to recover from the real error. Apparently repository was moved from mercurial into mercurial.interfaces, so changing the line above peerapi=1 to from mercurial.interfaces.repository import peer as peerrepository resolves the issue. I would file a bug report, but I was unable to find a place to report it, so I put it here.
Edit: Right, the file in question that needed editing was hgsubversion/svnrepo.py
My copy of hgsubversion seems to be up to date with http://hg.durin42.com/hgsubversion/
You have to use good and correct location as source of extension:
hg.durin42.com/hgsubversion is not maintained at least 18 months
* real hgsubversion repository now is at https://foss.heptapod.net/mercurial/hg-git
tip of this repo is a lot fresher and have all fixes, needed for HG v5
>hg log -r tip --style compact
1702[tip] d6ac1ae9027a 2020-08-04 00:23 +0200 a
gitnodekw: do not crash on hg incoming when log template includes gitnode()
On the rights of idea: you try to use TortoiseHG on your Ubuntu, which seems to have slightly more newest hgsubversion in library
I'm getting the following error when attempting to commit to a Hg repository:
Z:\wormcard_maker>hg commit -m "asdf"
transaction abort!
rollback completed
abort: phases.new-commit: not a valid phase name ('')
This happens over multiple different repositories and has survived re-cloning the repository and reinstalling Mercurial. I can commit to the repository fine from a different computer (running Linux).
I'm running Hg 4.8 as distributed with TortoiseHg 4.8 on Windows 7.
In TortoiseHg just set the "File - Settings - Commit - New Commit Phase" option.
I tried using the THG setting but it didn't work; just kept producing the same error.
(While doing this I noticed that the THG dropdown for the phase choices had a bunch of blank lines in it; so I think THG was confused.)
Instead I manually edited my HGRC file and made sure it contained:
[phases]
new-commit = secret
which worked.
You could obviously use draft, etc. in place of secret.
Neither of the other answers worked for me - even though I had new-commit = secret in the HGRC it still produced the error.
The workaround I found was to do this:
hg ci -m "message" --config phases.new-commit=secret
which did work, apparently by overriding whatever invalid phase name hg was trying to use. Even though I don't know why.
I assume this would work with other comments, not just ci (aka commit).
I have a repo on a network drive (served by Windows server), with local repos pushing/pulling to it on the various machines I work on.
I just dealt with this problem, and solved it by cloning the repo from the network drive to a local disk, pushing, then cloning it back again. The machine from which I did this had not problem pushing further changes after this.
Now I just tried pushing from my laptop, and this happens:
% hg --debug push "Z:\[main repo]"
pushing to Z:\[main repo]
query 1; heads
searching for changes
all remote heads known locally
listing keys for "bookmarks"
2 changesets found
list of changesets:
2ed25c8975482734e3b9eed828573fd711d26fd8
19a424c011ffd0c887cf1d54ed0b537a6c1af714
adding changesets
add changeset 2ed25c897548
add changeset 19a424c011ff
adding manifests
adding file changes
adding GEM.py revisions
transaction abort!
rollback completed
abort: No usable temporary file name found
[command returned code 255 Thu Mar 09 18:51:11 2017]
The only info pertaining to this error message I have found so far is this, and I definitely have no files named con.*in my project. There are several named con*.py but they have never been a problem, and both the laptop and my workstation are running Windows 7, and I've been working on this project for a few years now.
I have happily pushed from this laptop for over a year, and it was never a problem. I don't really have any good idea where to even start looking. Could it be connected to the fact that my workstation had the main repo opened at the same time? It was definitely not doing anything to it at the time.
Update:
I ran hg verify, and this is what it returns -- no problem as far as aI can tell
% hg --debug verify
repository uses revlog format 1
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
73 files, 74 changesets, 226 total revisions
[command completed successfully Fri Mar 10 08:58:02 2017]
I had faced the same error as well.
I just ran tortoise hg as as administrator and that fixed it for me
I don't have an answer yet but I would try the following:
Update to the latest mercurial version (4.1) and try again
Verify the repo integrity with hg verify
Although I understand it always worked as is, try to rename all the con.py files. The thing with CON is that it represents a device, I think it comes from DOS times :-)
If I understand correctly, you push to Z:[main repo] where Z: is a Windows share. Try to push to the same repo in another way, with ssh (requires some setup, yes)
Good luck, very bizarre problem :-/
I'm having this problem when trying to push to a remote server. It is a Mercurial repository on Phabricator. Here are my output.
hg commit -m "udpate README"
hg push
pushing to ssh://company.server
searching for changes
remote: abort: stream ended unexpectedly (got 0 bytes, expected 4)
I'm using the latest version of Mercurial 3.5.2+20151001 on Mac OS 10.10.
I have this problem from yesterday. During that time, I could successfully committed two times, although I did nothing.
Why the output somewhat looks like this question, the problem here is different, because I have deleted the repository and cloned again many times without any problem. (my first attempt to solve the problem)
The system admin and the server is at another city, so he can't take a look at my machine. Any help would be greatly appreciated.
This looks like there may be a problem with the server and client disagreeing on the new bundle2 format for the wire protocol introduced in 3.5. I'd recommend trying to temporarily downgrade to 3.4.2 (e.g. with pip install mercurial==3.4.2) to see if it fixes this. See this discussion on Phabricator. If it doesn't work, hg push --debug --traceback can provide more information on what exactly went wrong.
Got a bluescreen in windows while cloning a mercurial repository.
After reboot, I now get this message for almost all hg commands:
c:\src\>hg commit
waiting for lock on repository c:\src\McVrsServer held by '\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
interrupted!
Google is no help.
Any tips?
When "waiting for lock on repository", delete the repository file: .hg/wlock (or it may be in .hg/store/lock)
When deleting the lock file, you must make sure nothing else is accessing the repository. (If the lock is a string of zeros or blank, this is almost certainly true).
When waiting for lock on working directory, delete .hg/wlock.
I had this problem with no detectable lock files. I found the solution here: http://schooner.uwaterloo.ca/twiki/bin/view/MAG/HgLockError
Here is a transcript from Tortoise Hg Workbench console
% hg debuglocks
lock: user None, process 7168, host HPv32 (114213199s)
wlock: free
[command returned code 1 Sat Jan 07 18:00:18 2017]
% hg debuglocks --force-lock
[command completed successfully Sat Jan 07 18:03:15 2017]
cmdserver: Process crashed
PaniniDev% hg debuglocks
% hg debuglocks
lock: free
wlock: free
[command completed successfully Sat Jan 07 18:03:30 2017]
After this the aborted pull ran sucessfully.
The lock had been set more than 2 years ago, by a process on a machine that is no longer on the LAN. Shame on the hg developers for a) not documenting locks adequately; b) not timestamping them for automatic removal when they get stale.
Coworker had this exact problem today, after a BSoD while trying to push. He had to:
delete the file .hg/store/lock (as per the accepted answer)
delete the file .hg/store/phaseroots (as per this TortoiseHG bug report)
Then his repo worked again.
EDIT: As per #Marmoute's comment - when dealing with lock-related issues, using hg debuglock is a safer alternative to blindly deleting the .hg/store/lock file.
I am very familiar with Mercurial's locking code (as of 1.9.1). The above advice is good, but I'd add that:
I've seen this in the wild, but rarely, and only on Windows machines.
Deleting lock files is the easiest fix, BUT you have to make sure nothing else is accessing the repository. (If the lock is a string of zeros, this is almost certainly true).
(For the curious: I haven't yet been able to catch the cause of this problem, but suspect it's either an older version of Mercurial accessing the repository or a problem in Python's socket.gethostname() call on certain versions of Windows.)
I had the same problem. Got the following message when I tried to commit:
waiting for lock on working directory of <MyProject> held by '...'
hg debuglock showed this:
lock: free
wlock: (66722s)
So I did the following command, and that fixed the problem for me:
hg debuglocks -W
Using Win7 and TortoiseHg 4.8.7.
I had the same problem on Win 7.
The solution was to remove following files:
.hg/store/phaseroots
.hg/wlock
As for .hg/store/lock - there was no such file.
I do not expect this to be a winning answer, but it is a fairly unusual situation.
Mentioning in case someone other than me runs into it.
Today I got the "waiting for lock on repository" on an hg push command.
When I killed the hung hg command I could see no .hg/store/lock
When I looked for .hg/store/lock while the command was hung, it existed. But the lockfile was deleted when the hg command was killed.
When I went to the target of the push, and executed hg pull, no problem.
Eventually I realized that the process ID on the hg push was lock waiting message was changing each time. It turns out that the "hg push" was hanging waiting for a lock held by itself (or possibly a subprocess, I did not investigate further).
It turns out that the two workspaces, let's call them A and B, had .hg trees shared by symlink:
A/.hg --symlinked-to--> B/.hg
This is NOT a good thing to do with Mercurial. Mercurial does not understand the concept of two workspaces sharing the same repository. I do understand, however, how somebody coming to Mercurial from another VCS might want this (Perforce does, although not a DVCS; the Bazaar DVCS reportedly can do so). I am surprised that a symlinked REP-ROOT/.hg works at all, although it seems to except for this push.
If the locked repo was the original, I can't imagine it was modifying it to clone it, so it was only preventing you from changing it in the middle and messing up the clone. It should be fine after removing the lock.
The new cloned copy (if it was a local clone) could be in any sort of malformed state, though, so you should throw it out and start it over. (If it was a remote clone, I would hope it failed and already threw out the incomplete copy.)
I encountered this problem on Mac OS X 10.7.5 and Mercurial 2.6.2 when trying to push. After upgrading to Mercurial 3.2.1, I got "no changes found" instead of "waiting for lock on repository". I found out that somehow the default path had gotten set to point to the same repository, so it's not too surprising that Mercurial would get confused.
If it only happens on mapped drives it might be bug https://bitbucket.org/tortoisehg/thg/issue/889/cant-commit-file-over-network-share. Using UNC path instead of drive letter seems to sidestep the issue.