Commits

agriggio committed 7abfcce

ahg-log: fixed functions operating over a single file (diff, view, ...) of the current changeset

Fixed by making sure that ahg-log-filename-at-point returns absolute path names

  • Participants
  • Parent commits c732a73

Comments (0)

Files changed (1)

         (let ((pt (posn-point (event-end event))))
           (goto-char pt)
           (let* ((r1 (ahg-log-revision-at-point t))
-                 (r2 (ahg-first-parent-of-rev r1)))
-            (ahg-diff
-             r2 r1
-             (list (ahg-log-filename-at-point pt)))))))
+                 (r2 (ahg-first-parent-of-rev r1))
+                 (fn (ahg-log-filename-at-point pt)))
+            (ahg-diff r2 r1 (list fn))))))
     (define-key map "f"
       (lambda ()
         (interactive)
       (lambda ()
         (interactive)
           (let* ((r1 (ahg-log-revision-at-point t))
-                 (r2 (ahg-first-parent-of-rev r1)))
-            (ahg-diff r2 r1 (list (ahg-log-filename-at-point (point)))))))
+                 (r2 (ahg-first-parent-of-rev r1))
+                 (fn (ahg-log-filename-at-point (point))))
+            (ahg-diff r2 r1 (list fn)))))
     map))
 
 (defun ahg-log-filename-at-point (point)
   (interactive "d")
-  (save-excursion
-    (goto-char point)
-    (buffer-substring-no-properties
-     (+ 13 ;; (length "             ")
-        (point-at-bol))
-     (point-at-eol))))
+  (let ((fn 
+         (save-excursion
+           (goto-char point)
+           (buffer-substring-no-properties
+            (+ 13 ;; (length "             ")
+               (point-at-bol))
+            (point-at-eol)))))
+    (ahg-abspath fn)))
 
 (defun ahg-format-log-buffer ()
   (goto-char (point-min))
       (when (= (ahg-call-process "qapplied" nil global-opts) 0)
         (> (buffer-size) 0)))))
 
+(defun ahg-abspath (pth &optional root)
+  (unless root
+    (setq root (ahg-root)))
+  (expand-file-name pth (file-name-as-directory root)))
+
 ;;-----------------------------------------------------------------------------
 ;; log-edit related functions
 ;;-----------------------------------------------------------------------------