views:

694

answers:

4
$ mkdir foo
$ cd foo
$ hg init .
$ hg log
abort: Is a directory
$ hg history
abort: Is a directory

Darwin Host.local 9.6.1 Darwin Kernel Version 9.6.1: Wed Dec 10 10:38:33 PST 2008; root:xnu-1228.9.75~3/RELEASE_I386 i386

$ hg --version
Mercurial Distributed SCM (version 1.2.1)
$ python --version
Python 2.5.4

(all installed via macports)

Thoughts? The google gives us nothing.

Update:

(as root):

$ hg init /tmp/foo
$ cd /tmp/foo; hg log
(works)

(as user):

$ hg init /tmp/bar
$ cd /tmp/bar; hg log
abort: Is a directory

So Travis was right (see comments) it does look like a permission problem somewhere but where? This is a stock install of Leopard barely a week old and stock installs of macport versions of python and mercurial. I hope that isn't mercurial's idea of a good error message when it has a permission problem.

2nd update (from dkbits suggestions below):

$ 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

Also, the temp directory is where you expected it to be. Permissions look okay on it.

+1  A: 

Not a direct answer to your question, but I've successfully been using the Mercurial pre-packaged binaries from here with the standard Python 2.5.1 install on OSX 10.5 without issue.

$ 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
Dave K
I recall having to use python 2.5.4 due to some issue that was not implemented in python 2.5.4 with regards to HTTPS support I believe. I will look at python 2.6 however. I do suspect that this version problem. Thank you.
Schubert
A: 

From http://www.selenic.com/mercurial/bts/issue233, there is an interesting traceback:

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

Perhaps the permission error is with your temp folder? To find the temp dir, do..

$ python
>>> import tempfile
>>> print tempfile.gettempdir()

It's should be in /var/folders/[...]/[...]/-Tmp-/

Also inspired by the above link, you could try running..

$ hg init /tmp/bar
$ cd /tmp/bar
$ hg --traceback log
dbr
A: 

I found the problem:

If you symlink your .hgrc somewhere it causes this. Definitely a bug in mercurial (and a stupid error message at that).

$ rm -f ~/.hgrc
$ hg init foo
$ cd foo
$ hg log

(works)

$ 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

(works)

Schubert
Opened issue http://www.selenic.com/mercurial/bts/issue1705 for this.
Schubert
A: 

I took another look and it is actually caused by the .hgrc line:

style = gitweb

Why that is I'm not sure but the error message sure sucks still.

Schubert