Hi *,
I attached a small patch which allows to limit the output of xhg-log
to n revisions with an negative prefix arg (corresponding to hg -l
option).
This is extremely useful with big repositories, when one is only
interested in the latest changes.
cheers
sascha
ps: please CC me in any replies, I'm not subscribed to the list.
Please change the Subject header to a concise description of your patch.
Please describe your patch between the LOG-START and LOG-END markers:
<<LOG-START>>
When calling xhg-log with an negative prefix arg, limit output to n revisions.
<<LOG-END>>
[VERSION] dvc-dev-bzr
Bazaar (bzr) 0.17.0
Emacs : GNU Emacs 22.1.50.17 (i686-pc-linux-gnu, GTK+ Version 2.10.11)
of 2007-08-20 on kenny
--
Parents strongly cautioned -- this posting is intended for mature
audiences over 18. It may contain some material that many parents
would not find suitable for children and may include intense violence,
sexual situations, coarse language and suggestive dialogue.
=== modified file 'lisp/xhg.el'
--- lisp/xhg.el 2007-08-20 19:24:06 +0000
+++ lisp/xhg.el 2007-08-21 10:25:19 +0000
@@ -123,15 +123,17 @@
When run interactively, the prefix argument decides, which parameters are queried from the user.
C-u : Show patches also, use all revisions
C-u C-u : Show patches also, ask for revisions
-positive : Don't show patches, ask for revisions."
+positive : Don't show patches, ask for revisions.
+negative : Don't show patches, limit to n revisions."
(interactive "P")
(when (interactive-p)
(cond ((equal current-prefix-arg '(4))
(setq show-patch t)
(setq r1 nil))
((equal current-prefix-arg '(16))
- (setq show-patch t)))
- (when r1
+ (setq show-patch t)
+ (setq r1 1)))
+ (when (> r1 0)
(setq r1 (read-string "hg log, R1:"))
(setq r2 (read-string "hg log, R2:"))))
(let ((buffer (dvc-get-buffer-create 'xhg 'log))
@@ -141,7 +143,13 @@
(when (numberp r1)
(setq r1 (number-to-string r1)))
(when (> (length r1) 0)
- (setq command-list (append command-list (list "-r" r1)))))
+ (let ((r1-num (string-to-number r1)))
+ (if (> r1-num 0)
+ (setq command-list (append command-list (list "-r" r1)))
+ (setq command-list
+ (append command-list
+ (list "-l"
+ (number-to-string (abs r1-num)))))))))
(when r2
(when (numberp r2)
(setq r2 (number-to-string r2)))
_______________________________________________
Dvc-dev mailing list
[email protected]
https://mail.gna.org/listinfo/dvc-dev