Show More
@@ -47,6 +47,7 | |||||
47 | (require 'cl) |
|
47 | (require 'cl) | |
48 | (require 'diff-mode) |
|
48 | (require 'diff-mode) | |
49 | (require 'easymenu) |
|
49 | (require 'easymenu) | |
|
50 | (require 'executable) | |||
50 | (require 'vc) |
|
51 | (require 'vc) | |
51 |
|
52 | |||
52 |
|
53 | |||
@@ -295,6 +296,17 If the command does not exit with a zero | |||||
295 | (car res)) |
|
296 | (car res)) | |
296 | (cdr res)))) |
|
297 | (cdr res)))) | |
297 |
|
298 | |||
|
299 | (defun hg-sync-buffers (path) | |||
|
300 | "Sync buffers visiting PATH with their on-disk copies. | |||
|
301 | If PATH is not being visited, but is under the repository root, sync | |||
|
302 | all buffers visiting files in the repository." | |||
|
303 | (let ((buf (find-buffer-visiting path))) | |||
|
304 | (if buf | |||
|
305 | (with-current-buffer buf | |||
|
306 | (vc-buffer-sync)) | |||
|
307 | (hg-do-across-repo path | |||
|
308 | (vc-buffer-sync))))) | |||
|
309 | ||||
298 | (defun hg-buffer-commands (pnt) |
|
310 | (defun hg-buffer-commands (pnt) | |
299 | "Use the properties of a character to do something sensible." |
|
311 | "Use the properties of a character to do something sensible." | |
300 | (interactive "d") |
|
312 | (interactive "d") | |
@@ -732,8 +744,7 Key bindings | |||||
732 | modified-files) |
|
744 | modified-files) | |
733 | (unless root |
|
745 | (unless root | |
734 | (error "Cannot commit outside a repository!")) |
|
746 | (error "Cannot commit outside a repository!")) | |
735 | (hg-do-across-repo |
|
747 | (hg-sync-buffers root) | |
736 | (vc-buffer-sync)) |
|
|||
737 | (setq modified-files (hg-chomp (hg-run0 "--cwd" root "status" "-arm"))) |
|
748 | (setq modified-files (hg-chomp (hg-run0 "--cwd" root "status" "-arm"))) | |
738 | (when (and (= (length modified-files) 0) |
|
749 | (when (and (= (length modified-files) 0) | |
739 | (not hg-commit-allow-empty-file-list)) |
|
750 | (not hg-commit-allow-empty-file-list)) | |
@@ -789,6 +800,7 With a prefix argument, prompt for all o | |||||
789 | (and (not (eq rev2 'working-dir)) rev2)))) |
|
800 | (and (not (eq rev2 'working-dir)) rev2)))) | |
790 | (unless rev1 |
|
801 | (unless rev1 | |
791 | (setq rev1 "-1")) |
|
802 | (setq rev1 "-1")) | |
|
803 | (hg-sync-buffers path) | |||
792 | (let ((a-path (hg-abbrev-file-name path)) |
|
804 | (let ((a-path (hg-abbrev-file-name path)) | |
793 | diff) |
|
805 | diff) | |
794 | (hg-view-output ((if (equal rev1 rev2) |
|
806 | (hg-view-output ((if (equal rev1 rev2) |
General Comments 0
You need to be logged in to leave comments.
Login now