[PATCH 2 of 2] mercurial.el: change default log range to tip:0

NIIMI Satoshi sa2c at sa2c.net
Mon May 21 23:13:51 UTC 2007


# HG changeset patch
# User NIIMI Satoshi <sa2c at sa2c.net>
# Date 1179788716 -32400
# Node ID fc3e8ebcd7f76201a08bb2884f25148d471f13f5
# Parent  7d521254e9e0961dd6af3a67ed4dab9d360f1955
mercurial.el: change default log range to tip:0

If the tip revision is smaller than hg-rev-completion-limit (defaults
to 100), "hg log -r tip:-100" fails.

Since performance does not differ between "hg log -l 50 -r tip:0" and
"hg log -l 50 -r tip:-100" even on large repository, default range can
be changed from "tip:-100" to "tip:0" without any drawbacks.

diff --git a/contrib/mercurial.el b/contrib/mercurial.el
--- a/contrib/mercurial.el
+++ b/contrib/mercurial.el
@@ -1084,20 +1084,19 @@
   "Display the revision history of PATH.
 History is displayed between REV1 and REV2.
 Number of displayed changesets is limited to LOG-LIMIT.
-REV1 defaults to the tip, while
-REV2 defaults to `hg-rev-completion-limit' changes from the tip revision.
+REV1 defaults to the tip, while REV2 defaults to 0.
 LOG-LIMIT defaults to `hg-log-limit'.
 With a prefix argument, prompt for each parameter."
   (interactive (list (hg-read-file-name " to log")
                      (hg-read-rev " to start with"
                                   "tip")
                      (hg-read-rev " to end with"
-                                  (format "%d" (- hg-rev-completion-limit)))
+				  "0")
                      (hg-read-number "Output limited to: "
                                      hg-log-limit)))
   (let ((a-path (hg-abbrev-file-name path))
-        (r1 (or rev1 (format "-%d" hg-rev-completion-limit)))
-        (r2 (or rev2 rev1 "tip"))
+        (r1 (or rev1 "tip"))
+        (r2 (or rev2 "0"))
         (limit (format "%d" (or log-limit hg-log-limit))))
     (hg-view-output ((if (equal r1 r2)
                          (format "Mercurial: Log of rev %s of %s" rev1 a-path)
@@ -1118,15 +1117,14 @@
   "Display the revision history of the repository containing PATH.
 History is displayed between REV1 and REV2.
 Number of displayed changesets is limited to LOG-LIMIT,
-REV1 defaults to the tip, while
-REV2 defaults to `hg-rev-completion-limit' changes from the tip revision.
+REV1 defaults to the tip, while REV2 defaults to 0.
 LOG-LIMIT defaults to `hg-log-limit'.
 With a prefix argument, prompt for each parameter."
   (interactive (list (hg-read-file-name " to log")
                      (hg-read-rev " to start with"
                                   "tip")
                      (hg-read-rev " to end with" 
-                                  (format "%d" (- hg-rev-completion-limit)))
+				  "0")
                      (hg-read-number "Output limited to: "
                                      hg-log-limit)))
   (hg-log (hg-root path) rev1 rev2 log-limit))



More information about the Mercurial-devel mailing list