From: Dan Nicolaescu Date: Thu, 18 Sep 2008 17:01:41 +0000 (+0000) Subject: * vc-bzr.el (vc-bzr-show-log-entry): X-Git-Tag: emacs-pretest-23.0.90~2865 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=89d9800051690014d4b2099451f84579b246c001;p=emacs.git * vc-bzr.el (vc-bzr-show-log-entry): * vc-git.el (vc-git-show-log-entry): Deal with a nil argument, C-x v l for a directory uses that. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8af9e43e2f6..a0bfe340fe4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2008-09-18 Dan Nicolaescu + + * vc-bzr.el (vc-bzr-show-log-entry): + * vc-git.el (vc-git-show-log-entry): Deal with a nil argument, + C-x v l for a directory uses that. + 2008-09-18 Simon Josefsson * files.el (auto-mode-alist): Use sieve-mode for .sv, .siv, and diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index a9652639948..ddce0ed8222 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el @@ -468,15 +468,17 @@ REV non-nil gets an error." (defun vc-bzr-show-log-entry (revision) "Find entry for patch name REVISION in bzr change log buffer." (goto-char (point-min)) - (let (case-fold-search) - (if (re-search-forward - ;; "revno:" can appear either at the beginning of a line, or indented. - (concat "^[ ]*-+\n[ ]*revno: " - ;; The revision can contain ".", quote it so that it - ;; does not interfere with regexp matching. - (regexp-quote revision) "$") nil t) - (beginning-of-line 0) - (goto-char (point-min))))) + (when revision + (let (case-fold-search) + (if (re-search-forward + ;; "revno:" can appear either at the beginning of a line, + ;; or indented. + (concat "^[ ]*-+\n[ ]*revno: " + ;; The revision can contain ".", quote it so that it + ;; does not interfere with regexp matching. + (regexp-quote revision) "$") nil t) + (beginning-of-line 0) + (goto-char (point-min)))))) (defun vc-bzr-diff (files &optional rev1 rev2 buffer) "VC bzr backend for diff." diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 79466241691..90d8ee1289a 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el @@ -491,12 +491,13 @@ REVISION may have the form BRANCH, BRANCH~N, or BRANCH^ (where \"^\" can be repeated)." (goto-char (point-min)) - (search-forward "\ncommit" nil t - (cond ((string-match "~\\([0-9]\\)$" revision) - (1+ (string-to-number (match-string 1 revision)))) - ((string-match "\\^+$" revision) - (1+ (length (match-string 0 revision)))) - (t nil))) + (when revision + (search-forward "\ncommit" nil t + (cond ((string-match "~\\([0-9]\\)$" revision) + (1+ (string-to-number (match-string 1 revision)))) + ((string-match "\\^+$" revision) + (1+ (length (match-string 0 revision)))) + (t nil)))) (beginning-of-line)) (defun vc-git-diff (files &optional rev1 rev2 buffer)