Re: mercurial.el and hg-version-other-window
hg-version-other window is unimplemented in mercurial.el. The version
below works for me, YMMV.
--- a/contrib/mercurial.el Fri Jul 06 12:02:43 2007 +0200
+++ b/contrib/mercurial.el Sat Jul 14 11:27:58 2007 -0500
@@ -1261,9 +1261,22 @@
(interactive)
(error "not implemented"))
-(defun hg-version-other-window ()
- (interactive)
- (error "not implemented"))
+(defun hg-version-other-window (rev)
+ "Visit version REV of the current file in another window.
+If the current file is named `F', the version is named `F.~REV~'.
+If `F.~REV~' already exists, use it instead of checking it out again."
+ (interactive "sVersion to visit (default is workfile version): ")
+ (let* ((file buffer-file-name)
+ (version (if (string-equal rev "")
+ "tip"
+ rev))
+ (automatic-backup (vc-version-backup-file-name file version))
+ (manual-backup (vc-version-backup-file-name file version 'manual)))
+ (unless (file-exists-p manual-backup)
+ (if (file-exists-p automatic-backup)
+ (rename-file automatic-backup manual-backup nil)
+ (hg-run0 "-q" "cat" "-r" version "-o" manual-backup file)))
+ (find-file-other-window manual-backup)))
(provide 'mercurial)