##// END OF EJS Templates
Emacs: separate limitations of revision range and shown changesets....
FUJIWARA Katsunori -
r2316:3d58376a default
parent child Browse files
Show More
@@ -391,6 +391,16 b" Handle frickin' frackin' gratuitous even"
391 391 'hg-file-history))
392 392 path))))
393 393
394 (defun hg-read-number (&optional prompt default)
395 "Read a integer value."
396 (save-excursion
397 (if (or (not default) current-prefix-arg)
398 (string-to-number
399 (eval (list* 'read-string
400 (or prompt "")
401 (if default (cons (format "%d" default) nil) nil))))
402 default)))
403
394 404 (defun hg-read-config ()
395 405 "Return an alist of (key . value) pairs of Mercurial config data.
396 406 Each key is of the form (section . name)."
@@ -950,36 +960,55 b' With a prefix argument, prompt for the p'
950 960 (kill-entire-line))
951 961 (run-hooks 'hg-log-mode-hook))
952 962
953 (defun hg-log (path &optional rev1 rev2)
954 "Display the revision history of PATH, between REV1 and REV2.
955 REV1 defaults to hg-log-limit changes from the tip revision, while
956 REV2 defaults to the tip.
963 (defun hg-log (path &optional rev1 rev2 log-limit)
964 "Display the revision history of PATH.
965 History is displayed between REV1 and REV2.
966 Number of displayed changesets is limited to LOG-LIMIT.
967 REV1 defaults to the tip, while
968 REV2 defaults to `hg-rev-completion-limit' changes from the tip revision.
969 LOG-LIMIT defaults to `hg-log-limit'.
957 970 With a prefix argument, prompt for each parameter."
958 971 (interactive (list (hg-read-file-name " to log")
959 (hg-read-rev " to start with" "-1")
960 (hg-read-rev " to end with" (format "-%d" hg-log-limit))))
972 (hg-read-rev " to start with"
973 "tip")
974 (hg-read-rev " to end with"
975 (format "%d" (- hg-rev-completion-limit)))
976 (hg-read-number "Output limited to: "
977 hg-log-limit)))
961 978 (let ((a-path (hg-abbrev-file-name path))
962 (r1 (or rev1 (format "-%d" hg-log-limit)))
963 (r2 (or rev2 rev1 "-1")))
979 (r1 (or rev1 (format "-%d" hg-rev-completion-limit)))
980 (r2 (or rev2 rev1 "tip"))
981 (limit (format "%d" (or log-limit hg-log-limit))))
964 982 (hg-view-output ((if (equal r1 r2)
965 (format "Mercurial: Log of rev %s of %s" rev1 a-path)
966 (format "Mercurial: Log from rev %s to %s of %s"
967 r1 r2 a-path)))
968 (let ((revs (format "%s:%s" r1 r2)))
969 (if (> (length path) (length (hg-root path)))
970 (call-process (hg-binary) nil t nil "log" "-r" revs path)
971 (call-process (hg-binary) nil t nil "log" "-r" revs)))
983 (format "Mercurial: Log of rev %s of %s" rev1 a-path)
984 (format
985 "Mercurial: at most %s log(s) from rev %s to %s of %s"
986 limit r1 r2 a-path)))
987 (eval (list* 'call-process (hg-binary) nil t nil
988 "log"
989 "-r" (format "%s:%s" r1 r2)
990 "-l" limit
991 (if (> (length path) (length (hg-root path)))
992 (cons path nil)
993 nil)))
972 994 (hg-log-mode))))
973 995
974 (defun hg-log-repo (path &optional rev1 rev2)
996 (defun hg-log-repo (path &optional rev1 rev2 log-limit)
975 997 "Display the revision history of the repository containing PATH.
976 History is displayed between REV1, which defaults to the tip, and
977 REV2, which defaults to the initial revision.
978 Variable hg-log-limit controls the number of log entries displayed."
998 History is displayed between REV1 and REV2.
999 Number of displayed changesets is limited to LOG-LIMIT,
1000 REV1 defaults to the tip, while
1001 REV2 defaults to `hg-rev-completion-limit' changes from the tip revision.
1002 LOG-LIMIT defaults to `hg-log-limit'.
1003 With a prefix argument, prompt for each parameter."
979 1004 (interactive (list (hg-read-file-name " to log")
980 (hg-read-rev " to start with" "tip")
981 (hg-read-rev " to end with" (format "-%d" hg-log-limit))))
982 (hg-log (hg-root path) rev1 rev2))
1005 (hg-read-rev " to start with"
1006 "tip")
1007 (hg-read-rev " to end with"
1008 (format "%d" (- hg-rev-completion-limit)))
1009 (hg-read-number "Output limited to: "
1010 hg-log-limit)))
1011 (hg-log (hg-root path) rev1 rev2 log-limit))
983 1012
984 1013 (defun hg-outgoing (&optional repo)
985 1014 "Display changesets present locally that are not present in REPO."
General Comments 0
You need to be logged in to leave comments. Login now