Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 24, 2017

Conversation

mrighele
Copy link
Contributor

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.

When we use filenames returned by hg commands, we need to convert them to
tramp paths, if needed.
This patch fixes only monky-status; others may be needed
@durin42
Copy link

durin42 commented Nov 7, 2014

This works great for me in my limited testing.

@lbolla
Copy link
Collaborator

lbolla commented Feb 23, 2017

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
Copy link

durin42 commented Feb 24, 2017

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

@lbolla
Copy link
Collaborator

lbolla commented Feb 24, 2017

Do you have an example?

@durin42
Copy link

durin42 commented Feb 24, 2017

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

@lbolla
Copy link
Collaborator

lbolla commented Feb 24, 2017

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

@seanfarley
Copy link

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 lbolla merged commit 190079e into ananthakumaran:master Feb 24, 2017
@lbolla
Copy link
Collaborator

lbolla commented Feb 24, 2017

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

@mrighele
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants