Python mercurial+;OSX==失败?hg log abort:是一个目录

Python mercurial+;OSX==失败?hg log abort:是一个目录,python,macos,mercurial,Python,Macos,Mercurial,Darwin Host.local 9.6.1达尔文内核版本9.6.1:Wed Dec 10:38:33 PST 2008;根目录:xnu-1228.9.75~3/RELEASE_I386 I386 $ mkdir foo $ cd foo $ hg init . $ hg log abort: Is a directory $ hg history abort: Is a directory (全部通过macports安装) 想法?谷歌什么也没给我们 更新: (作为根): (作为用户): 所

Darwin Host.local 9.6.1达尔文内核版本9.6.1:Wed Dec 10:38:33 PST 2008;根目录:xnu-1228.9.75~3/RELEASE_I386 I386

$ mkdir foo
$ cd foo
$ hg init .
$ hg log
abort: Is a directory
$ hg history
abort: Is a directory
(全部通过macports安装)

想法?谷歌什么也没给我们

更新:

(作为根):

(作为用户):

所以特拉维斯是对的(见评论),这看起来确实像是某个地方的许可问题,但在哪里呢?这是Leopard的库存安装,刚安装一周,是macport版本的python和mercurial的库存安装。我希望这不是mercurial在出现权限问题时提供的好错误消息

第二次更新(来自以下dkbits建议):


此外,temp目录是您期望的位置。权限看起来还可以。

不是对您问题的直接回答,但我已经成功地将Mercurial预打包的二进制文件与OSX 10.5上的标准Python 2.5.1安装一起使用,没有任何问题

$ sudo dtruss hg log
[snip]
...
stat("/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-   packages/mercurial/templates/gitweb\0", 0xBFFFC7DC, 0x1000)      = 0 0
open_nocancel("/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mercurial/templates/gitweb\0", 0x0, 0x1B6)        = 3 0
fstat(0x3, 0xBFFFC900, 0x1B6)        = 0 0
close_nocancel(0x3)      = 0 0
write_nocancel(0x2, "abort: Is a directory\n\0", 0x16)       = 22 0
从中,有一个有趣的回溯:

$ mkdir foo
$ cd foo
$ hg init .
$ hg log
$ hg history

$ hg --version
Mercurial Distributed SCM (version 1.2.1)

$ python --version
Python 2.5.1
权限错误可能与您的临时文件夹有关?要查找临时目录,请执行

hg --traceback qpop
Traceback (most recent call last):
  [...]
  File "/export/home/bos/lib/python/mercurial/util.py", line 747, in o
    rename(mktempcopy(f), f)
  File "/export/home/bos/lib/python/mercurial/util.py", line 690, in mktempcopy
    fp.write(posixfile(name, "rb").read())
IOError: [Errno 21] Is a directory
abort: Is a directory
它应该位于
/var/folders/[…]/[…]/-Tmp-/

同样受到上述链接的启发,你可以尝试跑步

$ python
>>> import tempfile
>>> print tempfile.gettempdir()
我发现了问题:

如果将.hgrc符号链接到某个地方,则会导致此问题。肯定是mercurial中的一个bug(以及一条愚蠢的错误消息)

(工程)


(有效)

我又看了一眼,它实际上是由.hgrc行引起的:

style=gitweb


为什么我不确定,但错误消息仍然很糟糕。

没有提交时,为什么要查看日志?echo“foo”>test;汞添加试验;hg-commit-m“测试提交”;汞测井;中止:是一个目录。你很笨吗?问题是错误消息,不管您是否提交,问题仍然存在。当然,如果没有提交,它应该什么也不报告,但不能报告错误。+1“谷歌什么都不给我们。”我也没有遇到任何问题。我想到的是权限和一些关于路径的东西(可能是一些愚蠢的东西,比如空格?)?Schuberts在这里的评论是完全不恰当的,我记得我不得不使用Python2.5.4,因为我认为Python2.5.4在HTTPS支持方面没有实现一些问题。不过,我将介绍Python2.6。我怀疑这个版本有问题。非常感谢。
$ mkdir foo
$ cd foo
$ hg init .
$ hg log
$ hg history

$ hg --version
Mercurial Distributed SCM (version 1.2.1)

$ python --version
Python 2.5.1
hg --traceback qpop
Traceback (most recent call last):
  [...]
  File "/export/home/bos/lib/python/mercurial/util.py", line 747, in o
    rename(mktempcopy(f), f)
  File "/export/home/bos/lib/python/mercurial/util.py", line 690, in mktempcopy
    fp.write(posixfile(name, "rb").read())
IOError: [Errno 21] Is a directory
abort: Is a directory
$ python
>>> import tempfile
>>> print tempfile.gettempdir()
$ hg init /tmp/bar
$ cd /tmp/bar
$ hg --traceback log
$ rm -f ~/.hgrc
$ hg init foo
$ cd foo
$ hg log
$ ls -l ~/Dropbox/.hgrc
-rw-r--r--@ 1 schubert  staff  83 Jan  9 02:15 /Users/schubert/Dropbox/.hgrc
$ ln -s ~/Dropbox/.hgrc ~/.hgrc
$ hg log
abort: Is a directory
$ rm -f ~/.hgrc
$ hg log