Can't clone Mercurial repo on Windows, can do it on Linux - mercurial

Commands I'm using:
server:
hg init foo
hg serve -R foo
remote client:
hg clone http://IP_ADDRESS:8000
this works on Linux, but on Windows I get:
destination directory: 192.168.0.122:8000
abort: The directory name is invalid: 192.168.0.122:8000
if I do "hg clone http://IP_ADDRESS:8000/foo" then I get this on server side:
Exception happened during processing of request from ('127.0.0.1', 1681)
Traceback (most recent call last):
File "SocketServer.pyc", line 560, in process_request_thread
File "SocketServer.pyc", line 322, in finish_request
File "mercurial\hgweb\server.pyc", line 47, in __init__
File "SocketServer.pyc", line 617, in __init__
File "BaseHTTPServer.pyc", line 329, in handle
File "BaseHTTPServer.pyc", line 323, in handle_one_request
File "mercurial\hgweb\server.pyc", line 79, in do_GET
File "mercurial\hgweb\server.pyc", line 70, in do_POST
File "mercurial\hgweb\server.pyc", line 63, in do_write
File "mercurial\hgweb\server.pyc", line 127, in do_hgweb
File "mercurial\hgweb\hgweb_mod.pyc", line 86, in __call__
File "mercurial\hgweb\hgweb_mod.pyc", line 118, in run_wsgi
ErrorResponse
I'm using Mercurial 1.7.3 on Windows XP.

Try...
hg clone http://IP_ADDRESS:8000 DIRNAME
for some directory name DIRNAME. Windows is a bit more picky about what characters can and can't be in file (or directory) names, and thus it doesn't allow things like / or :, so instead you have to give it a name for a folder to clone into.

Related

Unable to install tortoisehg on Linux RHEL 7.4

I'm a long-time user of tortoisehg own Windows 7, but new to RedHat Linux.
I have python 2.7.5 installed on my Linux RHEL 7.4 virtual machine.
I installed hg (version 4.0-rc) by following these directions:
https://www.mercurial-scm.org/wiki/Download#Linux_.28.rpm.29
(I had to change 'baseurl=https://www.mercurial-scm.org/release/centos$releasever' to 'baseurl=https://www.mercurial-scm.org/release/centos7')
Then I downloaded and installed tortoisehg-4.2.2-1.fc27.noarch.rpm from:
https://kojipkgs.fedoraproject.org//packages/tortoisehg/4.2.2/1.fc27/noarch/tortoisehg-4.2.2-1.fc27.noarch.rpm
And tortoisehg-nautilus-4.2.2-1.fc27.noarch.rpm from:
https://kojipkgs.fedoraproject.org//packages/tortoisehg/4.2.2/1.fc27/noarch/tortoisehg-nautilus-4.2.2-1.fc27.noarch.rpm
hg seems to work, but when I try to start thg, I get the following error:
Traceback (most recent call last):
File "/usr/bin/thg", line 97, in
sys.exit(tortoisehg.hgqt.run.dispatch(argv))
File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line 152, in getattribute
self._load()
File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line 100, in _load
mod = _hgextimport(_import, head, globals, locals, None, level)
File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line 53, in _hgextimport
return importfunc(name, globals, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/tortoisehg/hgqt/run.py", line 400, in
_('repository root directory or symbolic path name')),
File "/usr/lib/python2.7/site-packages/tortoisehg/util/i18n.py", line 76, in agettext
return hglib.fromunicode(u)
File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line 152, in getattribute
self._load()
File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line 100, in _load
mod = _hgextimport(_import, head, globals, locals, None, level)
File "/usr/lib64/python2.7/site-packages/mercurial/demandimport.py", line 53, in _hgextimport
return importfunc(name, globals, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/tortoisehg/util/hglib.py", line 592, in
loadui = uimod.ui.load
AttributeError: type object 'ui' has no attribute 'load'
I have no idea how to proceed. Can anyone tell me what I'm doing wrong?
Thanks to Yuya N. at Unable to install thg on RHEL 7.4 Linux I was able to get thg working.
The problem was the the major.minor versions of hg and and tortoisehg must match.
I uninstalled tortoisehg-4.2.2-1 and installed tortoisehg-4.0.1 and thg now works.

Mercurial: abandoned transaction found run hg recover. missing revlogs

I recently tried to push to a central repository and received the error: abandoned transaction found. Running hg recover said there was no missing transaction. On the advice of another answer I used hg verify to see that my repository is missing two revlogs; below is the result of running hg verify:
% hg --repository C:\dev\WHDLawWeb verify --verbose
repository uses revlog format 1
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
data/WHDLawWeb/Images/pastsponsorships.jpg.d#167: missing revlog!
data/WHDLawWeb/WHDLawWeb/Resources/Image/ALFALogoWhite.jpg.i#319: missing revlog!
7175 files, 988 changesets, 14987 total revisions
2 integrity errors encountered!
(first damaged changeset appears to be 167)
[command returned code 1 Tue Jul 03 15:02:13 2012]
In an effort to correct this, and mostly due to my frustration at this point, I decided to just clone the central repository as I'd only be missing a few revisions. However, once I try to push from this cloned repository I get the following bug report:
** Mercurial version (2.2.2). TortoiseHg version (2.4.1)
** Command: --nofork workbench
** CWD: C:\dev
** Encoding: cp1252
** Extensions loaded: bugzilla, graphlog, convert, extdiff
** Python version: 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]
** Windows version: (6, 1, 7601, 2, 'Service Pack 1')
** Processor architecture: x86
** Qt-4.7.4 PyQt-4.8.6
Traceback (most recent call last):
File "tortoisehg\hgqt\repowidget.pyo", line 954, in repositoryChanged
File "tortoisehg\hgqt\repowidget.pyo", line 916, in rebuildGraph
File "tortoisehg\hgqt\repowidget.pyo", line 777, in setupModels
File "tortoisehg\hgqt\repomodel.pyo", line 151, in __init__
File "tortoisehg\hgqt\repomodel.pyo", line 170, in initBranchColors
File "mercurial\localrepo.pyo", line 523, in branchtags
File "mercurial\changelog.pyo", line 195, in read
File "mercurial\revlog.pyo", line 926, in revision
File "mercurial\revlog.pyo", line 849, in _chunkbase
File "mercurial\revlog.pyo", line 846, in _chunk
File "mercurial\revlog.pyo", line 115, in decompress
error: Error -5 while decompressing data: incomplete or truncated stream
Traceback (most recent call last):
File "tortoisehg\hgqt\commit.pyo", line 533, in repositoryChanged
File "tortoisehg\hgqt\commit.pyo", line 553, in refresh
File "tortoisehg\hgqt\thgrepo.pyo", line 631, in thgmqappliedpatch
File "tortoisehg\hgqt\thgrepo.pyo", line 623, in _thgmqpatchtags
File "mercurial\context.pyo", line 191, in tags
File "mercurial\localrepo.pyo", line 468, in nodetags
File "mercurial\util.pyo", line 237, in __get__
File "mercurial\localrepo.pyo", line 395, in _tagscache
File "mercurial\localrepo.pyo", line 428, in _findtags
File "mercurial\tags.pyo", line 30, in findglobaltags
File "mercurial\tags.pyo", line 242, in _readtagcache
File "mercurial\context.pyo", line 251, in filenode
File "mercurial\context.pyo", line 240, in _fileinfo
File "mercurial\context.pyo", line 183, in files
File "mercurial\util.pyo", line 237, in __get__
File "mercurial\context.pyo", line 134, in _changeset
File "mercurial\changelog.pyo", line 195, in read
File "mercurial\revlog.pyo", line 926, in revision
File "mercurial\revlog.pyo", line 849, in _chunkbase
File "mercurial\revlog.pyo", line 846, in _chunk
File "mercurial\revlog.pyo", line 115, in decompress
error: Error -5 while decompressing data: incomplete or truncated stream
Running hg verify on the central repository shows that the two revlogs are also missing here. If anyone knows how to fix either my original or cloned repository I'd appreciate any feedback.
Also tried a solution here and encountered the same problem. I'm relatively new to mercurial and tortiosehg, please forgive any stupid mistakes. Like I said help would be appreciated.

Mercurial share extension doesn't work with nested subrepos

I can't get mercurial share extension to work with nested repos.
Test repository structure:
SubrepoTest/
nested/
The SubrepoTest/.hgsub content:
nested = nested
Trying to share repo gives this error:
hg share --debug --traceback SubrepoTest Copy
updating working directory
resolving manifests
overwrite: False, partial: False
ancestor: 000000000000, local: 000000000000+, remote: 9d3080714601
.hgsub: remote created -> g
.hgsubstate: remote created -> g
New Text Document.txt: remote created -> g
calling hook preupdate.auto_update_hooks:
calling hook preupdate.auto_rhapsody:
Rhapsody not running.
updating: .hgsub 1/3 files (33.33%)
getting .hgsub
updating: .hgsubstate 2/3 files (66.67%)
getting .hgsubstate
subrepo merge 000000000000+ 9d3080714601 000000000000+
subrepo nested: remote added, get nested:6a97f6c97cf7b1fd1bd82cb528a7494980e17d62:hg
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 87, in _runcatch
File "mercurial\dispatch.pyo", line 696, in _dispatch
File "mercurial\dispatch.pyo", line 472, in runcommand
File "mercurial\extensions.pyo", line 184, in wrap
File "hgext\color.pyo", line 362, in colorcmd
File "mercurial\dispatch.pyo", line 786, in _runcommand
File "mercurial\dispatch.pyo", line 757, in checkargs
File "mercurial\dispatch.pyo", line 693, in
File "mercurial\util.pyo", line 463, in check
File "hgext\share.pyo", line 29, in share
File "mercurial\hg.pyo", line 175, in share
File "mercurial\hg.pyo", line 416, in update
File "mercurial\merge.pyo", line 596, in update
File "mercurial\merge.pyo", line 391, in applyupdates
File "mercurial\subrepo.pyo", line 183, in submerge
File "mercurial\subrepo.pyo", line 512, in get
File "mercurial\subrepo.pyo", line 494, in _get
File "mercurial\subrepo.pyo", line 247, in _abssource
Abort: default path for subrepository nested not found
abort: default path for subrepository nested not found
I'm using Mercurial Distributed SCM (version 2.2.2) from TortoiseHG for Windows.
How do I solve this problem?

Mercurial / TortoiseHg Issues with Jenkins Slave - A specified logon session does not exist

I've got a build that was previously working fine on the Jenkins Master node that I'm now trying to execute on the Jenkins slave.
I'm using the Jenkins Mercurial Plugin and pointing to the TortoiseHg installation directory on the slave machine.
The Mercurial repository that I'm using is secured by a self-signed certificate (hosted in IIS).
Working on the machine locally, I can clone the repository without issues (this is necessary to get TortoiseHg to preserve the user's password).
However, I seem to be running into issues getting this to work when the build is executed by Jenkins.
The specific error that I'm getting is listed below :
Building remotely on <slave> in workspace <workspace>
$ S:\Software\TortoiseHg/hg clone --rev default --noupdate https://<repository> <workspace_on_slave>
warning: <MercurialServerIP> certificate with fingerprint e3:5f:5e:ea:4f:da:ef:a4:0b:4a:bb:00:e8:31:59:de:ce:d0:28:94 not verified (check hostfingerprints or web.cacerts config setting)
** unknown exception encountered, please report by visiting
** http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)]
** Mercurial Distributed SCM (version 2.1.2)
** Extensions loaded: mercurial_keyring
Traceback (most recent call last):
File "hg", line 42, in <module>
File "mercurial\dispatch.pyo", line 27, in run
File "mercurial\dispatch.pyo", line 64, in dispatch
File "mercurial\dispatch.pyo", line 87, in _runcatch
File "mercurial\dispatch.pyo", line 685, in _dispatch
File "mercurial\dispatch.pyo", line 467, in runcommand
File "mercurial\dispatch.pyo", line 739, in _runcommand
File "mercurial\dispatch.pyo", line 693, in checkargs
File "mercurial\dispatch.pyo", line 682, in <lambda>
File "mercurial\util.pyo", line 456, in check
File "mercurial\commands.pyo", line 1157, in clone
File "mercurial\hg.pyo", line 250, in clone
File "mercurial\hg.pyo", line 93, in repository
File "mercurial\httprepo.pyo", line 236, in instance
File "mercurial\httprepo.pyo", line 57, in _fetchcaps
File "mercurial\httprepo.pyo", line 169, in _call
File "mercurial\httprepo.pyo", line 117, in _callstream
File "urllib2.pyo", line 397, in open
File "urllib2.pyo", line 510, in http_response
File "urllib2.pyo", line 429, in error
File "urllib2.pyo", line 369, in _call_chain
File "urllib2.pyo", line 864, in http_error_401
File "mercurial\url.pyo", line 429, in http_error_auth_reqed
File "hgext\mercurial_keyring.pyo", line 332, in basic_http_error_auth_reqed
File "urllib2.pyo", line 842, in http_error_auth_reqed
File "urllib2.pyo", line 845, in retry_http_basic_auth
File "hgext\mercurial_keyring.pyo", line 326, in find_user_password
File "hgext\mercurial_keyring.pyo", line 177, in find_auth
File "hgext\mercurial_keyring.pyo", line 60, in get_http_password
File "keyring\core.pyo", line 37, in get_password
File "keyring\backend.pyo", line 560, in get_password
File "keyring\backend.pyo", line 573, in _get_password
pywintypes.error: (1312, 'CredRead', 'A specified logon session does not exist. It may already have been terminated.')
ERROR: Failed to clone https://<repository>
Can anyone offer suggestions on what I can do to get past this?
Non-Polling Solution: (Useful if you're not doing polling of the repository to trigger builds)
The fix to this turns out to be to manually clone the repository on the slave at the workspace location (where it would normally end up).
It seems that once the repository is available on the slave, it's able to get past the 'A specified logon session does not exist. It may already have been terminated.' error.
Polling Solution: (The solution above does not seem to work with the Jenkins polling functionality, so we're left with the solution below).
See How do you specify authentication information for Mercurial as part of Jenkins? (mercurial_keyring)
The only way I was able to figure out how to get the server to remember the password (and work with polling) in my setup was to specify it manually in \mercurial.ini .
NOTE: You may also have to remove the mercurial_keyring line from mercurial.ini. (This disables the keyring extension on the Jenkins server/slave since we're specifying everything manually.)

Problem with Mercurial hg serve command

When using the hg serve command in windows, the server starts correctly, but when somebody tries to do a clone, this error appears.
$ hg serve
listening at http://machineX:8000/ (bound to *:8000)
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 4456)
Traceback (most recent call last):
File "SocketServer.pyc", line 558, in process_request_thread
File "SocketServer.pyc", line 320, in finish_request
File "mercurial\hgweb\server.pyc", line 42, in __init__
File "SocketServer.pyc", line 615, in __init__
File "BaseHTTPServer.pyc", line 329, in handle
File "BaseHTTPServer.pyc", line 323, in handle_one_request
File "mercurial\hgweb\server.pyc", line 74, in do_GET
File "mercurial\hgweb\server.pyc", line 65, in do_POST
File "mercurial\hgweb\server.pyc", line 58, in do_write
File "mercurial\hgweb\server.pyc", line 122, in do_hgweb
File "mercurial\hgweb\hgweb_mod.pyc", line 85, in __call__
File "mercurial\hgweb\hgweb_mod.pyc", line 117, in run_wsgi
ErrorResponse
----------------------------------------
It seems this is some sort of python error... I've already tried reinstalling to the lastest version of mercurial, but still the same problem occurs.
anybody else seen this before?
thanks!
It a dumb problem...
I was doing hg serve on my "hello" repository, and I was trying to access it as
hg clone http://machine:8000/hello
you shouldn't use the repo name in the address...
that is all.