Mercurial > hg > mercurial-crew-with-dirclash
comparison contrib/mercurial.el @ 2456:aa16b42628b8
merge with crew.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Sun, 18 Jun 2006 21:04:42 -0700 |
parents | ff83112332f9 b5902db74ba3 |
children | 8e1004c61796 |
comparison
equal
deleted
inserted
replaced
2455:ff83112332f9 | 2456:aa16b42628b8 |
---|---|
378 (defun hg-read-file-name (&optional prompt default) | 378 (defun hg-read-file-name (&optional prompt default) |
379 "Read a file or directory name, or a pattern, to use with a command." | 379 "Read a file or directory name, or a pattern, to use with a command." |
380 (save-excursion | 380 (save-excursion |
381 (while hg-prev-buffer | 381 (while hg-prev-buffer |
382 (set-buffer hg-prev-buffer)) | 382 (set-buffer hg-prev-buffer)) |
383 (let ((path (or default (buffer-file-name)))) | 383 (let ((path (or default (buffer-file-name) default-directory))) |
384 (if (or (not path) current-prefix-arg) | 384 (if (or (not path) current-prefix-arg) |
385 (expand-file-name | 385 (expand-file-name |
386 (eval (list* 'read-file-name | 386 (eval (list* 'read-file-name |
387 (format "File, directory or pattern%s: " | 387 (format "File, directory or pattern%s: " |
388 (or prompt "")) | 388 (or prompt "")) |
710 (hg-view-output ("Mercurial Help Overview") | 710 (hg-view-output ("Mercurial Help Overview") |
711 (insert (documentation 'hg-help-overview)) | 711 (insert (documentation 'hg-help-overview)) |
712 (let ((pos (point))) | 712 (let ((pos (point))) |
713 (insert (documentation 'hg-mode)) | 713 (insert (documentation 'hg-mode)) |
714 (goto-char pos) | 714 (goto-char pos) |
715 (kill-line)))) | 715 (end-of-line 1) |
716 (delete-region pos (point))))) | |
716 | 717 |
717 (defun hg-add (path) | 718 (defun hg-add (path) |
718 "Add PATH to the Mercurial repository on the next commit. | 719 "Add PATH to the Mercurial repository on the next commit. |
719 With a prefix argument, prompt for the path to add." | 720 With a prefix argument, prompt for the path to add." |
720 (interactive (list (hg-read-file-name " to add"))) | 721 (interactive (list (hg-read-file-name " to add"))) |
974 (error "not implemented")) | 975 (error "not implemented")) |
975 | 976 |
976 (defun hg-log-mode () | 977 (defun hg-log-mode () |
977 "Mode for viewing a Mercurial change log." | 978 "Mode for viewing a Mercurial change log." |
978 (goto-char (point-min)) | 979 (goto-char (point-min)) |
979 (when (looking-at "^searching for changes") | 980 (when (looking-at "^searching for changes.*$") |
980 (kill-entire-line)) | 981 (delete-region (match-beginning 0) (match-end 0))) |
981 (run-hooks 'hg-log-mode-hook)) | 982 (run-hooks 'hg-log-mode-hook)) |
982 | 983 |
983 (defun hg-log (path &optional rev1 rev2 log-limit) | 984 (defun hg-log (path &optional rev1 rev2 log-limit) |
984 "Display the revision history of PATH. | 985 "Display the revision history of PATH. |
985 History is displayed between REV1 and REV2. | 986 History is displayed between REV1 and REV2. |
1100 When called interactively, the root is printed. A prefix argument | 1101 When called interactively, the root is printed. A prefix argument |
1101 prompts for a path to check." | 1102 prompts for a path to check." |
1102 (interactive (list (hg-read-file-name))) | 1103 (interactive (list (hg-read-file-name))) |
1103 (if (or path (not hg-root)) | 1104 (if (or path (not hg-root)) |
1104 (let ((root (do ((prev nil dir) | 1105 (let ((root (do ((prev nil dir) |
1105 (dir (file-name-directory (or path buffer-file-name "")) | 1106 (dir (file-name-directory |
1107 (or | |
1108 path | |
1109 buffer-file-name | |
1110 (expand-file-name default-directory))) | |
1106 (file-name-directory (directory-file-name dir)))) | 1111 (file-name-directory (directory-file-name dir)))) |
1107 ((equal prev dir)) | 1112 ((equal prev dir)) |
1108 (when (file-directory-p (concat dir ".hg")) | 1113 (when (file-directory-p (concat dir ".hg")) |
1109 (return dir))))) | 1114 (return dir))))) |
1110 (when (interactive-p) | 1115 (when (interactive-p) |