ananthakumaran / monky

Magit for Hg
http://ananthakumaran.in/monky/index.html
GNU General Public License v3.0
154 stars 30 forks source link

monky-get-root-dir doesn't work with remote repositories #25

Closed mrighele closed 7 years ago

mrighele commented 12 years ago

monky-get-root-dir uses "hg root" to get the root for the repository. When we are working with remote repositories, we need to convert the output to a tramp path.

durin42 commented 9 years ago

This works great for me in my limited testing.

lbolla commented 7 years ago

I struggle to understand how Tramp syntax for a remote path and Hg syntax for a remote can "work together"? Can you please provide and example .hgrc to highlight this feature?

durin42 commented 7 years ago

If you call out to hg with the correct emacs functions, emacs is smart enough to run the process on the remote host.

lbolla commented 7 years ago

Do you have an example?

durin42 commented 7 years ago

I'm pretty sure you're already doing this correctly - that is, if you apply this patch, then most things Just Work.

lbolla commented 7 years ago

I just want to understand what feature this patch is implementing, before merging it.

seanfarley commented 7 years ago

I struggle to understand how Tramp syntax for a remote path and Hg syntax for a remote can "work together"?

There really isn't anything Mercurial specific here. It's just Tramp and mounting files over ssh. If you call hg root on a file in /tmp/foo (since Tramp is copying files over in the background), then it's probably going to error out saying it's the file is not in a repo.

However, if you juggle this right, then emacs will shell out to calling hg root on the remote machine, thereby returning the correct /some/path/on/my/remote/server. Since that's a file not known to us locally, we'll need to massage the output so emacs can open it via Tramp.

Hopefully, that explains enough to show that this is mostly a Tramp issue which happens to shell out to Mercurial (perhaps it's confusing that Tramp / git / hg all have a 'remote' concept that differs here).

lbolla commented 7 years ago

@seanfarley Thanks for the explanation, it is clear now.

mrighele commented 7 years ago

Sorry for not replying before. I realize the description of the issue is not really correct. As @seanfarley pointed out the issue was not much with remote repositories, as with remote working directories.