contrib/mercurial.el
changeset 4693 3f484688c702
parent 4433 ba22e867cb23
child 4694 6bf58c9400e2
equal deleted inserted replaced
4692:c135c6cddbec 4693:3f484688c702
  1081 
  1081 
  1082 (defun hg-log (path &optional rev1 rev2 log-limit)
  1082 (defun hg-log (path &optional rev1 rev2 log-limit)
  1083   "Display the revision history of PATH.
  1083   "Display the revision history of PATH.
  1084 History is displayed between REV1 and REV2.
  1084 History is displayed between REV1 and REV2.
  1085 Number of displayed changesets is limited to LOG-LIMIT.
  1085 Number of displayed changesets is limited to LOG-LIMIT.
  1086 REV1 defaults to the tip, while
  1086 REV1 defaults to the tip, while REV2 defaults to 0.
  1087 REV2 defaults to `hg-rev-completion-limit' changes from the tip revision.
       
  1088 LOG-LIMIT defaults to `hg-log-limit'.
  1087 LOG-LIMIT defaults to `hg-log-limit'.
  1089 With a prefix argument, prompt for each parameter."
  1088 With a prefix argument, prompt for each parameter."
  1090   (interactive (list (hg-read-file-name " to log")
  1089   (interactive (list (hg-read-file-name " to log")
  1091                      (hg-read-rev " to start with"
  1090                      (hg-read-rev " to start with"
  1092                                   "tip")
  1091                                   "tip")
  1093                      (hg-read-rev " to end with"
  1092                      (hg-read-rev " to end with"
  1094                                   (format "%d" (- hg-rev-completion-limit)))
  1093 				  "0")
  1095                      (hg-read-number "Output limited to: "
  1094                      (hg-read-number "Output limited to: "
  1096                                      hg-log-limit)))
  1095                                      hg-log-limit)))
  1097   (let ((a-path (hg-abbrev-file-name path))
  1096   (let ((a-path (hg-abbrev-file-name path))
  1098         (r1 (or rev1 (format "-%d" hg-rev-completion-limit)))
  1097         (r1 (or rev1 "tip"))
  1099         (r2 (or rev2 rev1 "tip"))
  1098         (r2 (or rev2 "0"))
  1100         (limit (format "%d" (or log-limit hg-log-limit))))
  1099         (limit (format "%d" (or log-limit hg-log-limit))))
  1101     (hg-view-output ((if (equal r1 r2)
  1100     (hg-view-output ((if (equal r1 r2)
  1102                          (format "Mercurial: Log of rev %s of %s" rev1 a-path)
  1101                          (format "Mercurial: Log of rev %s of %s" rev1 a-path)
  1103                        (format 
  1102                        (format 
  1104                         "Mercurial: at most %s log(s) from rev %s to %s of %s"
  1103                         "Mercurial: at most %s log(s) from rev %s to %s of %s"
  1115 
  1114 
  1116 (defun hg-log-repo (path &optional rev1 rev2 log-limit)
  1115 (defun hg-log-repo (path &optional rev1 rev2 log-limit)
  1117   "Display the revision history of the repository containing PATH.
  1116   "Display the revision history of the repository containing PATH.
  1118 History is displayed between REV1 and REV2.
  1117 History is displayed between REV1 and REV2.
  1119 Number of displayed changesets is limited to LOG-LIMIT,
  1118 Number of displayed changesets is limited to LOG-LIMIT,
  1120 REV1 defaults to the tip, while
  1119 REV1 defaults to the tip, while REV2 defaults to 0.
  1121 REV2 defaults to `hg-rev-completion-limit' changes from the tip revision.
       
  1122 LOG-LIMIT defaults to `hg-log-limit'.
  1120 LOG-LIMIT defaults to `hg-log-limit'.
  1123 With a prefix argument, prompt for each parameter."
  1121 With a prefix argument, prompt for each parameter."
  1124   (interactive (list (hg-read-file-name " to log")
  1122   (interactive (list (hg-read-file-name " to log")
  1125                      (hg-read-rev " to start with"
  1123                      (hg-read-rev " to start with"
  1126                                   "tip")
  1124                                   "tip")
  1127                      (hg-read-rev " to end with" 
  1125                      (hg-read-rev " to end with" 
  1128                                   (format "%d" (- hg-rev-completion-limit)))
  1126 				  "0")
  1129                      (hg-read-number "Output limited to: "
  1127                      (hg-read-number "Output limited to: "
  1130                                      hg-log-limit)))
  1128                                      hg-log-limit)))
  1131   (hg-log (hg-root path) rev1 rev2 log-limit))
  1129   (hg-log (hg-root path) rev1 rev2 log-limit))
  1132 
  1130 
  1133 (defun hg-outgoing (&optional repo)
  1131 (defun hg-outgoing (&optional repo)