projectile icon indicating copy to clipboard operation
projectile copied to clipboard

Projectile not recognizing hg projects

Open M-Taan opened this issue 2 years ago • 13 comments

Expected behavior

Going into a mercurial project and calling projectile-add-to-known-project Then when trying to switch to the newly added project using projectile-switch-project It should show the files inside that project.

Actual behavior

It's showing me files inside my home directory instead

1665309705

Steps to reproduce the problem

projectile-add-to-known-project to a mercurial project Then trying to go into that project using projectile-switch-project

Mercurial Version

version 6.2.3

Projectile version information

Projectile: 20221004.1327

Emacs version

Emacs 28.2

Operating system

Running Arch Linux: 5.19.13-arch1-1

M-Taan avatar Oct 09 '22 09:10 M-Taan

It works correctly just for .emacs.d 1665310127

M-Taan avatar Oct 09 '22 10:10 M-Taan

After some tinkering, it seems that it doesn't work on projects that use mercurial, but works just fine for git projects. I'll update the issue accordingly.

M-Taan avatar Oct 09 '22 11:10 M-Taan

I haven't used Mercurial in ages - it's possible that our project detection there is broken. Should be an easy thing to fix.

bbatsov avatar Oct 25 '22 08:10 bbatsov

In fact, not just Mercurial projects aren't being detected, but neither are Fossil. And using an empty .projectile file also does not work.

zilti avatar Oct 31 '22 22:10 zilti

@zilti I'll try to find some time to reproduce this, but the logic for project detection hasn't been change in a while. This definitely makes me wonder what has happened. You can try setting a breakpoint in projectile-project-root (or rather one of the root detection functions it calls) and see what happens there.

bbatsov avatar Nov 01 '22 05:11 bbatsov

I've tested this with .projectile project just now and it works fine for me.

bbatsov avatar Nov 01 '22 08:11 bbatsov

I also cloned a Mercurial project now and it works fine:

image

So, I can't reproduce any of the problems outline here.

bbatsov avatar Nov 01 '22 08:11 bbatsov

Are you using the latest version of Projectile? Perhaps you can post your config here?

At any rate - it'd be good to do the debugging exercise I suggested earlier.

bbatsov avatar Nov 01 '22 08:11 bbatsov

Hey @bbatsov, I'll give it a try in my free time and try what you suggested earlier.

M-Taan avatar Nov 01 '22 08:11 M-Taan

My Projectile version is 2.6.0-snapshot, the one that comes with Doom Emacs. It seems Doom manipulates the variables for project detection. Weirdly though .projectile does not work there even though they left it in... Anyway I will open an issue over @doomemacs.

zilti avatar Nov 01 '22 11:11 zilti

I forgot to mention that the debugging instructions are here https://docs.projectile.mx/projectile/troubleshooting.html#debugging-projectile-commands

bbatsov avatar Nov 01 '22 14:11 bbatsov

Hey, adding .projectile did indeed work with Mercurial projects

M-Taan avatar Nov 17 '22 19:11 M-Taan

Hi @zilti, I am seeing something similar in Doom Emacs: https://discourse.doomemacs.org/t/projectile-does-not-seem-to-consider-non-git-repos/4611/2

Did you ever open an issue? I realize this was almost 2 years ago but trying not to duplicate things.

jbwyatt4 avatar May 21 '24 18:05 jbwyatt4