working in an emacs shell

Boylan, Ross Ross.Boylan at ucsf.edu
Mon Aug 17 19:54:11 UTC 2015


Running in a bash shell under non-graphical emacs I did an hg merge, and gibberish showed up on the screen when it tried to resolve conflicts.  My guess is it was trying to run vi in this environment, because there were messages about :quit.  Eventually I got out of it, but it was a mess.

1. Is there a better way to do this within an emacs shell? https://mercurial.selenic.com/wiki/MergingWithEmacs has some notes, but I'm not at all sure they are appropriate if already running in an emacs shell.

2. emacs has a mercurial mode, which in retrospect would probably have been a better choice.  But I'd have to learn it, and it wouldn't leave a trace in the session log that the bash shell provides.

It may be the easiest thing would be to start a terminal under X and execute the command from there, presumably getting a nice graphical merge tool.  But I'd like to be able to use mercurial from the command line inside an emacs shell.

My effort to abort the whole process doesn't seem to have worked.  I got the message "was the merge successful" twice and said "n" both times.  Then I did "hg update -C" as (almost) instructed (I forgot the "."), but it seemed to merge anyway.  hg summary before the merge showed the parent as revision 1, but it now shows as 30.

3. Why didn't the hg update -C abort the transaction?  Was it just that I forgot the final .?  Or is it just that my hg is too old (2.2.2, Debian oldstable aka wheezy)?  I think I recall a change comment that aborting merges didn't work well in earlier versions.  emacs 23.4.1.

Here's a fragment of the attempted abort, starting with the last file merge message.
<terminal>
was merge successful (yn)? n
merging sync.py failed!
2 files updated, 0 files merged, 0 files removed, 2 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
ross at tempserver:~/src/FileSync2$ hg update -C
4 files updated, 0 files merged, 0 files removed, 0 files unresolved
ross at tempserver:~/src/FileSync2$ hg status
? sync.map.orig
? sync.py.orig
ross at tempserver:~/src/FileSync2$ hg summ
parent: 30:ec4239d8b1d4 tip
 Add preview argument to list actual files to be transferred.
branch: default
commit: 2 unknown (clean)
update: 2 new changesets, 2 branch heads (merge)
</terminal>

Further background: I had created a minimal hg repository with some of the files; it had the initial commit and one revision in it.  Then I did hg pull from a repository created from rcs using instructions https://mercurial.selenic.com/wiki/ConvertExtension#Converting_from_RCS.  I had to use the -f option to pull the apparently unrelated repository.

Thanks.
Ross Boylan


More information about the Mercurial mailing list