2

Im using the emacs binary from http://emacsformacosx.com/ When I'm editing a file in a mercurial source directory and run "ediff-revision" I get:

"File /the/file/im/editing.py is not under version control"

This command works on the vanilla windows distribution and also with aquamacs, is there something I need to do for vanilla GNU Emacs for mac to work correctly?

I've tried it with only this in my .emacs

(require 'ediff)
cag
  • 492
  • 3
  • 14
  • 1
    Does `vc-diff` work or doesn't it neither? Is Mercurial actually installed on that Mac system? – Rörd Mar 03 '11 at 09:45
  • vc-diff doesn't work either. Yes mercurial is installed, vc-diff and ediff-revision work fine if I use Aquamacs. For some reason, it just won't work with GNU emacs (I've even tried compiling it myself with the same results) I expect it's a bug, but thought I'd see if anyone had it working before I submitted it. – cag Mar 03 '11 at 15:21
  • If you suspect it is a bug, try asking at #emacs on irc.freenode.org and/or gnu.emacs.help newsgroup before submitting it. Many from those places don't frequent here. – vpit3833 Mar 03 '11 at 17:06
  • Hang on, I use the Emacs from the same place mentioned in the question too. `vc-diff` works on the soure tree I pulled from mercurial repository. I just did a `hg pull && hg update`. Also, `ediff-revision` works just as expected too. Can you give more details about what you do and what happens? – vpit3833 Mar 03 '11 at 17:23
  • Sure, I have, for example an emacs repository at the root of my home dir "~/emacs" From terminal I can hg anything and it works fine. However, if I edit a file in the directory "test.el" and run ediff-revision, I get the message "is not under version control". I'm thinking of just using aquamacs because it works just fine, however I'd prefer to use the GNU binary if it works. Are you loading anything special? – cag Mar 03 '11 at 18:13
  • I don't have anything loaded specific for hg. I tried what you described on the golang sources, with `emacs -q -Q -nw` and `emacs -nw -Q` and `emacs -nw -q` to be sure nothing is loaded. I can reproduce the same behaviour you describe in each of these instances. But in the Emacs that launches from the dock, I can clearly see both `vc-diff` and `ediff-revision` working. I couldn't figure the reason for this behaviour yet. – vpit3833 Mar 03 '11 at 19:53
  • And, on a Debian testing system with Emacs 23.2, emacs is just able to tell whether a file is under hg or cvs or svn, along with whether or not it has changed from the most recent baselined version, independent of how it(emacs) was started. I think Aquamacs is your simplest option at the moment. Sorry, couldn't help better. – vpit3833 Mar 03 '11 at 21:52

3 Answers3

2

So Mercurial for OSX installs itself in /usr/local/bin It seems emacs knows to look there in the Aquamacs and the command line versions. To get it working for GNU emacs I made a symbolic link of /usr/local/bin/hg in /usr/bin After that, every thing started working just fine.

# Open Terminal
cd /usr/bin
sudo ln -s /usr/local/bin/hg hg

Another method I ran across was to set the variable vc-path, however I couldn't get that solution to work. Thanks for those that took a stab at this.

Nightfirecat
  • 11,432
  • 6
  • 35
  • 51
cag
  • 492
  • 3
  • 14
  • I had the same problem except my Mercurial was in `/opt/local/bin/hg`, not `/usr/bin`. If you´re unsure where Mercurial is installed, run `which hg`. – Joakim Hårsman Mar 20 '11 at 10:03
0

I had to do 2 things to get it working right for me.

First, make sure Emacs' vc system can see hg:

(add-to-list 'exec-path "/usr/local/bin")

And second, make sure that hg can be found from the shell:

(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))

Dave F
  • 973
  • 9
  • 19
0

I faced the similar situation and tell you my story.

Typing C-x v = (vc-diff) on a buffer I have been working on I got:

File is not under version control

What? Then I came here, checked every comment posted above, and found nothing irregular.

Hmm... What is wrong? The status bar shows like this:

U:--- xxx.py     84% (500, 38)    (Py Outl)

I tried to open another file in the same directory by typing C-x d RET (dired), then g to update the buffer, C-n to move to another file, e to open it. Well, this time the status bar shows like this:

-:--- yyy.py     All (1, 0)     Hg-0    (Py Outl)

Now I got a point! Firstly, I had started editing the first file with Aquamacs (emacs variant for Mac OS). Secondly, I did hg init, hg ci -m 'Imported the first version' .

Okay, C-x k (kill-buffer) to close xxx.py and then open it again. Bingo! Now the status bar shows like this:

-:--- xxx.py     Bot (500, 0)    Hg:0   (Py Outl)

Everything works fine now. You have a nice day!

Tora
  • 970
  • 1
  • 8
  • 15