views:

98

answers:

1

I would like to use a GUI app on my Mac (Changes http://connectedflow.com/changes/) to resolve merge conflicts when using Mercurial via SSH on my server.

What is the most straightforward way to achieve this without cloning the repository locally?

A: 

If it were me, I would either:

  • Clone the remote repository, merge locally, then push the merge
  • Mount the remote repository, then merge locally (if you've got ssh access, you can use macfuse)
David Wolever
I suppose the other option would be to write a small script which would copy three files to your computer, let you merge them, then copy them back… But that seems like a lot of trouble. Just cloning locally, merging, then pushing is probably a lot easier.
David Wolever
I will keep cloning for now. It's just that I wanted a more seamless interaction. Since many apps on mac can read remote files, edit them and upload them back upon saving (BBedit, Textmate etc...) I thought there could be a mechanism to do something similar with Mercurial and SomeDiffApp...
tmslnz
It's an interesting idea. The tricky part would be sending the "open these files" from the server. I mean, if you don't mind doing it manually, you could write little script like this: `echo "$0"; echo "$1"; echo "$2"; read`, set it as your Mercurial mergetool, then open the three echo'd files manually… But that kind of sucks :(
David Wolever
Interesting. We might be getting closer to what I had in mind. Do you know if by SSHing back to my computer from the server could help? I have a sense that there might be something there...
tmslnz
Sure — if your home computer is SSH accessible, then you could have the script do something like: `ssh $LAPTOP_HOSTNAME "/path/to/merge/program ssh://$SERVER_HOSTNAME/$0 ssh://$SERVER_HOSTNAME/$1 ssh://$SERVER_HOSTNAME/$2"`, or something similar.
David Wolever
David: yes, one could let the merge program SSH back to the laptop, but the merge program triggered on the laptop will need some help before it can open a windows on the laptops display. I'm not sure what it entails with a Mac, but if he is also running X11, then setting the DISPLAY environment variable is a first step.In other words -- it will probably be quite complicated and I would advice against it. Like R4an says above, part of being a distributed revision control system is to work on local clones.
Martin Geisler
@Martin: I don't know exactly how MacOS determines how to run graphical applications, but in this case, it will Just Work (ie, when you SSH back into the laptop, assuming you use the same username as the user who is graphically logged in, graphical applications will open as expected). Now, that said — yes, this would be *very* complicated and fiddly… But what fun would computers be without some complicated and fiddly bits?
David Wolever
@David: Hehe, please write to the Mercurial mailinglist ([email protected]) if you get something like this working... :-) Btw, that list is really the correct place to ask user questions about Mercurial.
Martin Geisler