(let* ((checkout-list nil)
;; Iterate over each line in the buffer.
;; 2. Since this is called from dired-after-reading-hook, it can get
;; called on a single-line buffer. In this case there is no subdir,
;; and no checkout-list. We need to call clearcase-fprop-checked-out
- ;; to te
xt for a checkout.
+ ;; to tet for a checkout.
;; Case 1: Look for directory markers
((setq subdir (dired-get-subdir))
+ (setq subdir-native (clearcase-path-canonicalise-slashes
+ (clearcase-path-native subdir)))
;; We're at a subdirectory line in the dired buffer.
;; Go and list all checkouts in this subdirectory.
;; Case 2: Look for files (the safest way to get the filename).
- ((setq fullpath (dired-get-filename nil t))
+ ((setq filename (dired-get-filename 'no-dir t))
;; Expand it to get rid of . and .. entries.
- (setq fullpath (expand-file-name fullpath))
+ (setq fullpath-native (concat subdir-native filename))
;; Only modify directory listings of the correct format.
;; We replace the GID field with a checkout indicator.
(replacement-length (- replacement-end replacement-begin))
(replacement-text (format "CHECKOUT"))
(is-checkout (if checkout-list
- (member fullpath checkout-list)
- (clearcase-fprop-checked-out fullpath))))
+ (member fullpath-native checkout-list)
+ (clearcase-fprop-checked-out (expand-file-name filename)))))
;; Highlight the line if the file is checked-out.
- (insert (substring replacement-text 0 replacement-length)))
- ;; Highlight the checked out files.
- (if (fboundp 'put-text-property)
- (let ((buffer-read-only nil))
- (put-text-property replacement-begin replacement-end
- 'face 'clearcase-dired-checkedout-face)))
- (message "Reformatting...Done"))
+ (insert (substring replacement-text 0 replacement-length))
+ ;; Highlight the checked out files.
+ (if (fboundp 'put-text-property)
+ (put-text-property replacement-begin replacement-end
+ 'face 'clearcase-dired-checkedout-face))))
+ (message "Reformatting...Done")))
(defun clearcase-dired-list-checkouts (directory)
"Returns a list of files checked-out to the current view in DIRECTORY."
;; Give the directory as an argument so all names will be
+ (clearcase-path-canonicalise-slashes (clearcase-path-native other-file))
+ (clearcase-path-canonicalise-slashes (clearcase-path-native truename)))))
(if (clearcase-file-is-in-mvfs-p truename)
(clearcase-diff-files other-vxpath truename)
- (clearcase-diff-files (clearcase-vxpath-get-version-in-temp-file other-vxpath)
+ (let ((temp-file (clearcase-vxpath-get-version-in-temp-file other-vxpath)))
+ (clearcase-diff-files temp-file truename)
+ (delete-file temp-file)))))
+ (clearcase-path-native file)))))
(defun clearcase-diff-files (file1 file2)
"Run cleardiff on FILE1 and FILE2 and display the differences."
- (if clearcase-use-normal-diff
- (clearcase-do-command 2 clearcase-normal-diff-program file2 clearcase-normal-diff-switches file1)
- (clearcase-do-command 2 "cleardiff" file2 "-diff_format" file1))
- (let ((diff-size (save-excursion
- (set-buffer "*clearcase*")
- (message "No differences")
- (clearcase-port-view-buffer-other-window "*clearcase*")
+ ;; Fix `file1' path since it's passed as a fully-qualified argument
+ ;; to the command. `file2' will be split into path and base name
+ ;; parts in `clearcase-do-command' which works correctly whether the
+ ;; path is native or not. If we do decide that `file2' should also
+ ;; be fixed up, the rigtht place is probably within
+ ;; `clearcase-do-command' as `file2' becomes the one known file
+ (let ((file1 (clearcase-path-native file1)))
+ (if clearcase-use-normal-diff
+ (clearcase-do-command 2 clearcase-normal-diff-program file2 clearcase-normal-diff-switches file1)
+ (clearcase-do-command 2 "cleardiff" file2 "-diff_format" file1))
+ (let ((diff-size (save-excursion
+ (set-buffer "*clearcase*")
+ (message "No differences")
+ (clearcase-port-view-buffer-other-window "*clearcase*")
(defun clearcase-fprop-get-properties (file)
- "For FILE, make sure it
's ClearCase properties are in the hashtable
+ "For FILE, make sure its ClearCase properties are in the hashtable
(or (clearcase-fprop-lookup-properties file)
(predecessor (clearcase-fprop-predecessor-version file))
(default-filename (clearcase-vxpath-cons-vxpath file predecessor))
- ;; To get this to
o work it is necessary to make Emacs think
+ ;; To get this to work it is necessary to make Emacs think
;; we're completing with respect to "ELEMENT@@/" rather
;; than "ELEMENT@@". Otherwise when we enter a version
;; like "/main/NN", it thinks we entered an absolute path.