emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog vc-git.el


From: Alexandre Julliard
Subject: [Emacs-diffs] emacs/lisp ChangeLog vc-git.el
Date: Fri, 13 Mar 2009 20:04:16 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Alexandre Julliard <julliard>   09/03/13 20:04:16

Modified files:
        lisp           : ChangeLog vc-git.el 

Log message:
        * vc-git.el (vc-git-previous-revision, vc-git-next-revision):
        Fall back to original commit if vc-git-symbolic-commit fails to
        find a symbolic name.
        (vc-git-symbolic-commit): Don't limit search to tags. Treat
        "undefined" as an error. (Bug #2110)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15463&r2=1.15464
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-git.el?cvsroot=emacs&r1=1.80&r2=1.81

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15463
retrieving revision 1.15464
diff -u -b -r1.15463 -r1.15464
--- ChangeLog   13 Mar 2009 19:59:44 -0000      1.15463
+++ ChangeLog   13 Mar 2009 20:04:11 -0000      1.15464
@@ -1,3 +1,11 @@
+2009-03-13  Alexandre Julliard  <address@hidden>
+
+       * vc-git.el (vc-git-previous-revision, vc-git-next-revision):
+       Fall back to original commit if vc-git-symbolic-commit fails to
+       find a symbolic name.
+       (vc-git-symbolic-commit): Don't limit search to tags. Treat
+       "undefined" as an error. (Bug #2110)
+
 2009-03-13  D. Goel  <address@hidden>
 
        * ibuf-ext.el: 

Index: vc-git.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc-git.el,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -b -r1.80 -r1.81
--- vc-git.el   11 Feb 2009 06:36:34 -0000      1.80
+++ vc-git.el   13 Mar 2009 20:04:15 -0000      1.81
@@ -576,10 +576,9 @@
 (defun vc-git-previous-revision (file rev)
   "Git-specific version of `vc-previous-revision'."
   (if file
-      (let ((default-directory (file-name-directory (expand-file-name file)))
-            (file (file-name-nondirectory file)))
-        (vc-git-symbolic-commit
-         (with-temp-buffer
+      (let* ((default-directory (file-name-directory (expand-file-name file)))
+             (file (file-name-nondirectory file))
+             (prev-rev (with-temp-buffer
            (and
             (vc-git--out-ok "rev-list" "-2" rev "--" file)
             (goto-char (point-max))
@@ -589,6 +588,7 @@
             (buffer-substring-no-properties
              (point)
              (1- (point-max)))))))
+        (or (vc-git-symbolic-commit prev-rev) prev-rev))
     (with-temp-buffer
       (and
        (vc-git--out-ok "rev-parse" (concat rev "^"))
@@ -609,9 +609,9 @@
              (bobp)
              (buffer-substring-no-properties
               (point)
-              (1- (point-max)))))))
+              (1- (point-max))))))
+         (next-rev
     (and current-rev
-        (vc-git-symbolic-commit
          (with-temp-buffer
            (and
             (vc-git--out-ok "rev-list" "HEAD" "--" file)
@@ -620,7 +620,8 @@
             (zerop (forward-line -1))
             (buffer-substring-no-properties
              (point)
-             (progn (forward-line 1) (1- (point))))))))))
+                   (progn (forward-line 1) (1- (point)))))))))
+    (or (vc-git-symbolic-commit next-rev) next-rev)))
 
 (defun vc-git-delete-file (file)
   (vc-git-command nil 0 file "rm" "-f" "--"))
@@ -731,13 +732,14 @@
   "Translate COMMIT string into symbolic form.
 Returns nil if not possible."
   (and commit
-       (with-temp-buffer
+       (let ((name (with-temp-buffer
         (and
-         (vc-git--out-ok "name-rev" "--name-only" "--tags" commit)
+                      (vc-git--out-ok "name-rev" "--name-only" commit)
          (goto-char (point-min))
          (= (forward-line 2) 1)
          (bolp)
          (buffer-substring-no-properties (point-min) (1- (point-max)))))))
+         (and name (not (string= name "undefined")) name))))
 
 (provide 'vc-git)
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]