i compiled mercurial successfully as follows:
...
copying build/scripts-2.7/hg -> /usr/local/bin
changing mode of /usr/local/bin/hg to 755
running install_egg_info
Writing /usr/local/lib/python2.7/site-packages/mercurial-2.8.1-py2.7.egg-info
as3:~/mercurial-2.8.1# cd ~
as3:~# hg clone http://hg.cat-v.org/werc/
Traceback (most recent call last):
File "/usr/bin/hg", line 25, in <module>
mercurial.util.set_binary(fp)
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 103, in __getattribute__
return getattr(self._module, attr)
AttributeError: 'module' object has no attribute 'set_binary'
as3:~#
how to fix it?tks.
my python version:2.7.6
Note that you have installed mercurial from sources into /usr/local/bin, but the error message mentions /usr/bin/hg. It means you have a different version of mercurial main script installed under /usr/bin/hg, which then tries to use new mercurial library from /usr/local. The error occurs, because the 2 are incompatible.
To fix this, remove older mercurial from /usr/bin. You may need to call rehash in your shell as well, for it to pick it up, depending on the shell.
If mercurial does not work then, it means /usr/local/bin is not in your PATH. If that is the case you'll need to fix the PATH, or just symlink new hg, like so:
# ln -s /usr/local/bin/hg /usr/bin
But that will require root access, for example, calling it through sudo.
Related
I can't commit a single file by Mercurial. Here are different variants of the command:
The variant with --traceback
C:\Users\543829657\workspace\dev.appl.ib.cbl>hg commit --traceback "--message=Ad
ded a task Xml2Java for creation request/response files" --user "Petr Gangnus <petr.gangnus#moneta.cz>" -- application/build.gradle
transaction abort!
rollback completed
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 160, in _runcatch
File "mercurial\dispatch.pyo", line 885, in _dispatch
File "mercurial\dispatch.pyo", line 646, in runcommand
File "mercurial\extensions.pyo", line 168, in closure
File "hgext\color.pyo", line 521, in colorcmd
File "mercurial\dispatch.pyo", line 976, in _runcommand
File "mercurial\dispatch.pyo", line 947, in checkargs
File "mercurial\dispatch.pyo", line 882, in <lambda>
File "mercurial\util.pyo", line 716, in check
File "mercurial\commands.pyo", line 1546, in commit
File "mercurial\cmdutil.pyo", line 2456, in commit
File "mercurial\commands.pyo", line 1540, in commitfunc
File "mercurial\localrepo.pyo", line 64, in wrapper
File "mercurial\localrepo.pyo", line 1508, in commit
File "mercurial\localrepo.pyo", line 64, in wrapper
File "mercurial\localrepo.pyo", line 1596, in commitctx
File "mercurial\extensions.pyo", line 168, in closure
File "c:/Users/543829657/workspace/mercurial-tools/commitsigs.py", line 357, in add
File "c:/Users/543829657/workspace/mercurial-tools/commitsigs.py", line 168, in opensslsign
File "subprocess.pyo", line 710, in __init__
File "subprocess.pyo", line 958, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
abort: The system cannot find the file specified
The variant with --debug
C:\Users\543829657\workspace\dev.appl.ib.cbl>hg commit --debug "--message=
Added a task Xml2Java for creation request/response files" --user "Petr Gangnus <petr.gangnus#moneta.cz>"
-- application/build.gradle
calling hook precommit.checkfiles: hghook_precommit_checkfiles.fixup_hook
checkfiles: removing tabs and/or trailing whitespace in changed files...
checkfiles: opts:
checkfiles: checked extensions:
checkfiles: ignored extensions: .sln .suo .vcproj .csproj .ui
checkfiles: ignored files:
checkfiles: check diffs only: False
checkfiles: use spaces: True
checkfiles: tab size: 4
checkfiles: considering files:
application/build.gradle
checkfiles: application/build.gradle ok
committing files:
application/build.gradle
committing manifest
committing changelog
transaction abort!
rollback completed
abort: The system cannot find the file specified
My colleagues and me had cleaned the project committed, re-cloned it, pulled changes or not, checked all python scripts and ssh keys for reachability... It should be OK, but it is not.
I have a suspision that while the error in the "--debug" variant appears after committing changelog, it could be something with it? I don't see any file that is named "changelog" in the project and there are three containing that word and they all are obviously old - cloned from repository.
About duplication of questions. It seems that that or similar message pops up in very many absolutely different situations:
Mercurial Editor: "abort: The system cannot find the file specified" - The commit fails in this very place of the same script, but... The stack itself is different, and there fails only the commit without the message. I have the message. And the author tries to use an alternative default editor and cannot - that is his problem, absolutely different from mine. I haven't changed the editor. I have not troubles with editor. I have installed hg, cloned project, changed one file and want to commit it - that is all.
TortoiseHg can't commit--"The system cannot find the file specified" - here the error message header is not "abort:", but "abort: Adding: "
android studio gradle refresh failed (The system cannot find the file specified) - here the commit is called from Android Studio and the file IS specified
"abort: The system cannot find the file specified" in Mercurial - the messages are almost the same, only the missing file IS specified by Mercurial. And the stack is different. And in my case I can update, whereas that author could not.
In others cases on SO with that error message it is not Mercurial what invokes the error.
I have looked at many similar cases on different sites, and I had not found the same problem. Always something important was different.
#Leon has supposed an interesting version below - that the reason is incorrectly set openssl/gnupg. I have checked installation of openssl, ran hg help commitsigs - and reading the ouput, noticed such interesting property as forcesign.
If the parametr is specified with a value of 1, the commit process will be
aborted and rolled back if the changeset cannot be signed for whatever reason
(bad setup, expired certificate and so on. The default is that the commit
will still be successful, but not signed.
Yes, it looks promising. ...But even setting that property to 0 changed nothing in the situation.
The commitsigs.py entries in your stack trace suggest that the problem is due to the Commitsigs Extension. Check that
you have gnupg or openssl installed on your system
you have a valid GPG key (in case of gnupg) or a X509 certificate (in case of openssl)
and Commitsigs is properly configured (run hg help commitsigs for details). In particular, the path to gnupg or openssl must be correctly specified, otherwise you may run into the described problem even when commitsigs.forcesign mode is disabled.
I have a pretxncommit hook that uses Python script. This Python script is itself under version control in the same repo. Everything worked fine until I added changes to script itself, which led to a bunch of errors when trying to commit or merge with such changes.
How can I fix this? The best solution I can come up with is to use a subrepo, but I don't really like it.
Error example:
Traceback (most recent call last):
File "hg", line 43, in <module>
File "mercurial\dispatch.pyc", line 30, in run
TypeError: unsupported operand type(s) for &: 'str' and 'int'
Running a hook where the script is found in the repository itself can be tricky if a commit means that hook script changes during execution or is erronous - especially as the script itself can be in a somewhat undefined state at some point when it is modified itself.
One solution is to run the hook from another site outside the repository, like ~/bin and use additionally a hook in the post-commit or maybe txnclose which updates the script version as found in ~/bin from the repository, possibly preceeded by a sanity test to make sure you don't update to a broken version.
That's the way I update all scripts which run my compile farm: they all are in a CF-related repository, and hooks to that CF-related repository first trigger test runs with the newly committed versions to ensure the CF will work with them and subsequently only updates the scripts for the CF permanently when those tests pass successfully.
I just installed Sublime-jshint (and the requisite node.js + jshint) but get this error when I try to invoke JSHint from within ST2:
[Errno 2] No such file or directory
[cmd: [u'jshint', u'PATH-TO-THE-JS-FILE-I-AM-LINTING', u'--reporter', u'/home/cmg/.config/sublime-text-2/Packages/JSHint/reporter.js']]
[dir: DIR-MY-JS-FILE-IS-IN]
[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/cmg/bin]
[Finished]
The final item in the given path is in the home dir of my user (cmg), so it's been customized somehow... but I don't recall how, so I don't know how to add the dir I need (~/node_modules/.bin).
I've added it to $PATH in my shell (via both .bashrc and .bash_profile) but ST2 doesn't pick it up.
(I'm on Ubuntu 14.04. All the usable stuff I've found via Google on this subject has been either OS X specific or related to ST's build system).
Basically, the exec command, which the jshint package uses internally, allows you to set/extend the PATH of the spawned subprocess. (docs)
The package actually uses this path argument on OSX, but has it hardcoded (I am partly guilty of that as I rewrote the command because it was just horrible before). It should allow for a setting to specify the path to your jshint executable, so I suggest you create an issue for that.
I don't know why ST dosn't pick up your PATH from somewhere else since I have very little experience with that.
Open /etc/profile in Sublime (using sudo) and add the following line at the very bottom:
export PATH=/home/cmg/node_modules/.bin:$PATH
and save the file. Restart completely, and your PATH should be updated.
I have a problem getting Mercurial to recognise my editor. I have a file, c:\windows\notepad.exe and typing "notepad" at the command prompt works. I can commit by using the "-m" argument to supply the commit title. But a simple "hg commit" brings up the error.
A call to "hg --traceback commit" brings up:
Traceback (most recent call last):
File "mercurial\dispatch.pyc", line 47, in _runcatch
File "mercurial\dispatch.pyc", line 466, in _dispatch
File "mercurial\dispatch.pyc", line 336, in runcommand
File "mercurial\dispatch.pyc", line 517, in _runcommand
File "mercurial\dispatch.pyc", line 471, in checkargs
File "mercurial\dispatch.pyc", line 465, in <lambda>
File "mercurial\util.pyc", line 401, in check
File "mercurial\commands.pyc", line 708, in commit
File "mercurial\cmdutil.pyc", line 1150, in commit
File "mercurial\commands.pyc", line 706, in commitfunc
File "mercurial\localrepo.pyc", line 836, in commit
File "mercurial\cmdutil.pyc", line 1155, in commiteditor
File "mercurial\cmdutil.pyc", line 1184, in commitforceeditor
File "mercurial\ui.pyc", line 361, in edit
File "mercurial\util.pyc", line 383, in system
File "subprocess.pyc", line 470, in call
File "subprocess.pyc", line 621, in __init__
File "subprocess.pyc", line 830, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified
abort: The system cannot find the file specified
I've tried setting the HGEDITOR environment variable, setting "visual =" and "editor =" in the Mercurial.ini file. I tried full path as well as command only. I also tried copying the notepad.exe file into both the current folder as well as the mercurial folder.
Ideally I would like to use the editor at this location "C:\PortableApps\Notepad++Portable\Notepad++Portable.exe", but at this stage I would be happy with any editor!
HG debugconfig output:
c:\wamp\www\SiteAB.com\web>hg debugconfig
bundle.mainreporoot=c:\wamp\www\SiteAB.com\web
ui.username=killroy
ui.shell=true
ui.verbose=true
ui.visual="C:\PortableApps\Notepad++Portable\Notepad++Portable.exe"
ui.editor="C:\PortableApps\Notepad++Portable\Notepad++Portable.exe"
That editor = notepad didn't work suggests something is wrong with your environment. Since running notepad from the command line works, I wonder if maybe the problem is with your python installation. Your backtrace makes me think you're running hg 1.5 which was current when you posted. While I don't believe it should make a difference, it couldn't hurt to update to 1.5.4.
You're running Notepad++Portable from your C: drive. Usually one installs PortableApps to a removable drive. Are you sure hg should look at C:? I understand sometimes it can be handy for unpriviledged users to install them locally. Notepad++Portable won't play particularly nice with hg. You'll need to have npp completely closed and spawn it from hg or commits won't work. If you can, I'd try running the full version of Notepad++ instead. Here's what I use:
[ui]
editor = "C:\Program Files\Notepad++\notepad++.exe" -multiInst -nosession
-multiInst tells npp to open a new instance just for hg. That way it won't interfere with any npp windows you already have open. This does not work with the PortableApps version.
-nosession tells npp not to open any files you previously had open, speeding startup times and reducing clutter. When I'm writing a commit message, I want to focus on my message, and not be distracted by a bunch of unrelated tabs.
When you set editor = in the Mercurial.ini file, you're doing it within the [ui] section, right?
After doing that maybe provide the output of hg debugconfig ?
I'm facing some problems after installing Trac on my Windows 7 Ultimate 64bits using BitNami.
The Issues are:
Subversion Control
During the installation process, when the BitNami setup asks for the project repository directory, it only accept if you write a path that doesn't exist, otherwise you can't continue. So i got forced to point the path to "C:\Repositories\TRAC" (a new folder) instead of "C:\Repositories\DBG" (where the repository of the project that i was creating really are). So, after the installation, I've changed the trac.ini file at the key
[trac]
repository_dir = C:\Repositories\TRAC
repository_type = svn
to
[trac]
repository_dir = C:\Repositories\DBG
repository_type = svn
And now, when I login to the DBG project in Trac, it warns:
Warning: Can't synchronize with the
repository (The 'repository_dir' has
changed, a 'trac-admin resync'
operation is needed.). Look in the
Trac log for more information.
When I go to cmd the following happens:
C:\Users\Fernando>cd\
C:\>cd C:\Program Files\BitNami Trac Stack\trac\Scripts
C:\Program Files\BitNami Trac Stack\trac\Scripts>trac-admin resync
Welcome to trac-admin 0.11.6
Interactive Trac administration console.
Copyright (c) 2003-2009 Edgewall Software
Type: '?' or 'help' for help on commands.
Trac [C:\Program Files\BitNami Trac Stack\trac\Scripts\resync]> resync
Failed to open environment. [Errno 2] No such file or directory: 'C:\\Program Fi
les\\BitNami Trac Stack\\trac\\Scripts\\resync\\VERSION'
Traceback (most recent call last):
File "c:\program files\bitnami trac stack\trac\lib\site-packages\Trac-0.11.6-p
y2.5.egg\trac\admin\console.py", line 177, in env_open
self.__env = Environment(self.envname)
File "c:\program files\bitnami trac stack\trac\lib\site-packages\Trac-0.11.6-p
y2.5.egg\trac\env.py", line 209, in __init__
self.verify()
File "c:\program files\bitnami trac stack\trac\lib\site-packages\Trac-0.11.6-p
y2.5.egg\trac\env.py", line 277, in verify
fd = open(os.path.join(self.path, 'VERSION'), 'r')
IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\BitNami Trac S
tack\\trac\\Scripts\\resync\\VERSION'
C:\Program Files\BitNami Trac Stack\trac\Scripts>
What it should be?
2-Configuring Logo:
I can't find where to place my project logo to be shown in left-top corner!
at the header_logo key:
[header_logo]
alt = DBG
height = 50
link = http://localhost:801/trac/DBG
src = ITINT150.png
width = 150
i've placed the ITINT150.png file in the same folder as trac.ini for testing (obviously i wasn't going to leave it there), but trac doesn't find it, looking at the html code of the link tag generated, it points to: src="/trac/DBG/chrome/common/ITINT150.png", but where is this folder located, so i can place the image there?
Thanks in advance!
For the resync, the first argument to trac-admin is the trac environment directory. So run
trac-admin <path-to-trac-environment> resync
As of Trac 0.12, the above command changed to:
trac-admin <path-to-trac-environment> repository resync <repository-name or '*'>
For the logo, set the src to site/ITINT150.png, and put ITINT150.png into the <path-to-trac-environment>/htdocs directory.
I tried #retracile's solution but I received a "Command not found" message from trac-admin. This is what eventually worked for me:
trac-admin </path/to/trac/env> repository resync "*"
That last argument specifies the repository to resync and can be switched with the name of a specific repo (presumably with the quotes intact; I didn't try it) if you don't want to resync all repos. See here for details: http://trac.edgewall.org/wiki/TracAdmin