Show More
@@ -514,6 +514,8 Push changes G | |||
|
514 | 514 | (insert (documentation 'hg-help-overview)))) |
|
515 | 515 | |
|
516 | 516 | (defun hg-add (path) |
|
517 | "Add PATH to the Mercurial repository on the next commit. | |
|
518 | With a prefix argument, prompt for the path to add." | |
|
517 | 519 | (interactive (list (hg-read-file-name " to add"))) |
|
518 | 520 | (let ((buf (current-buffer)) |
|
519 | 521 | (update (equal buffer-file-name path))) |
@@ -536,6 +538,11 Push changes G | |||
|
536 | 538 | (error "not implemented")) |
|
537 | 539 | |
|
538 | 540 | (defun hg-diff (path &optional rev1 rev2) |
|
541 | "Show the differences between REV1 and REV2 of PATH. | |
|
542 | When called interactively, the default behaviour is to treat REV1 as | |
|
543 | the tip revision, REV2 as the current edited version of the file, and | |
|
544 | PATH as the file edited in the current buffer. | |
|
545 | With a prefix argument, prompt for all of these." | |
|
539 | 546 | (interactive (list (hg-read-file-name " to diff") |
|
540 | 547 | (hg-read-rev " to start with") |
|
541 | 548 | (let ((rev2 (hg-read-rev " to end with" 'working-dir))) |
@@ -557,6 +564,10 Push changes G | |||
|
557 | 564 | diff)) |
|
558 | 565 | |
|
559 | 566 | (defun hg-forget (path) |
|
567 | "Lose track of PATH, which has been added, but not yet committed. | |
|
568 | This will prevent the file from being incorporated into the Mercurial | |
|
569 | repository on the next commit. | |
|
570 | With a prefix argument, prompt for the path to forget." | |
|
560 | 571 | (interactive (list (hg-read-file-name " to forget"))) |
|
561 | 572 | (let ((buf (current-buffer)) |
|
562 | 573 | (update (equal buffer-file-name path))) |
@@ -575,6 +586,9 Push changes G | |||
|
575 | 586 | (error "not implemented")) |
|
576 | 587 | |
|
577 | 588 | (defun hg-log (path &optional rev1 rev2) |
|
589 | "Display the revision history of PATH, between REV1 and REV2. | |
|
590 | REV1 defaults to the initial revision, while REV2 defaults to the tip. | |
|
591 | With a prefix argument, prompt for each parameter." | |
|
578 | 592 | (interactive (list (hg-read-file-name " to log") |
|
579 | 593 | (hg-read-rev " to start with" "-1") |
|
580 | 594 | (hg-read-rev " to end with" (format "-%d" hg-log-limit)))) |
@@ -609,6 +623,9 Push changes G | |||
|
609 | 623 | (message "Reverting %s...done" buffer-file-name))) |
|
610 | 624 | |
|
611 | 625 | (defun hg-revert-buffer () |
|
626 | "Revert current buffer's file back to the latest committed version. | |
|
627 | If the file has not changed, nothing happens. Otherwise, this | |
|
628 | displays a diff and asks for confirmation before reverting." | |
|
612 | 629 | (interactive) |
|
613 | 630 | (let ((vc-suppress-confirm nil) |
|
614 | 631 | (obuf (current-buffer)) |
@@ -628,6 +645,10 Push changes G | |||
|
628 | 645 | (hg-revert-buffer-internal)))) |
|
629 | 646 | |
|
630 | 647 | (defun hg-root (&optional path) |
|
648 | "Return the root of the repository that contains the given path. | |
|
649 | If the path is outside a repository, return nil. | |
|
650 | When called interactively, the root is printed. A prefix argument | |
|
651 | prompts for a path to check." | |
|
631 | 652 | (interactive (list (hg-read-file-name))) |
|
632 | 653 | (let ((root (do ((prev nil dir) |
|
633 | 654 | (dir (file-name-directory (or path (buffer-file-name))) |
@@ -643,9 +664,18 Push changes G | |||
|
643 | 664 | root)) |
|
644 | 665 | |
|
645 | 666 | (defun hg-status (path) |
|
667 | "Print revision control status of a file or directory. | |
|
668 | With prefix argument, prompt for the path to give status for. | |
|
669 | Names are displayed relative to the repository root." | |
|
646 | 670 | (interactive (list (hg-read-file-name " for status" (hg-root)))) |
|
647 | 671 | (let ((root (hg-root))) |
|
648 | (hg-view-output (hg-output-buffer-name) | |
|
672 | (hg-view-output ((format "Mercurial: Status of %s in %s" | |
|
673 | (let ((name (substring (expand-file-name path) | |
|
674 | (length root)))) | |
|
675 | (if (> (length name) 0) | |
|
676 | name | |
|
677 | "*")) | |
|
678 | (hg-abbrev-file-name root))) | |
|
649 | 679 | (apply 'call-process (hg-binary) nil t nil |
|
650 | 680 | (list "--cwd" root "status" path))))) |
|
651 | 681 |
General Comments 0
You need to be logged in to leave comments.
Login now