[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vc-hgcmd e6f1105 25/87: Use relative file names for all
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vc-hgcmd e6f1105 25/87: Use relative file names for all commands |
Date: |
Sat, 5 Jun 2021 16:11:39 -0400 (EDT) |
branch: externals/vc-hgcmd
commit e6f1105e9e93120f3acb29fd018d0a1606198ddb
Author: muffinmad <andreyk.mad@gmail.com>
Commit: muffinmad <andreyk.mad@gmail.com>
Use relative file names for all commands
---
vc-hgcmd.el | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/vc-hgcmd.el b/vc-hgcmd.el
index 392df40..57be3e3 100644
--- a/vc-hgcmd.el
+++ b/vc-hgcmd.el
@@ -446,7 +446,7 @@ Insert 'Running command' and display buffer text if COMMAND"
"Call UPDATE-FUNCTION with status for files in DIR or FILES."
;; TODO track file renames with -C option
(let ((command (if files
- (nconc (list "status" "-A") files)
+ (nconc (list "status" "-A") (mapcar
#'file-relative-name files))
(list "status" (file-relative-name dir)))))
(vc-hgcmd--run-command
(make-vc-hgcmd--command
@@ -496,7 +496,7 @@ Insert 'Running command' and display buffer text if COMMAND"
(defun vc-hgcmd-working-revision (file)
"Working revision. Return repository working revision if FILE is committed."
- (if (and file (eq 'added (vc-state file)))
+ (if (and file (eq 'added (vc-state (file-relative-name file))))
"0"
(or (vc-hgcmd-command "log" "-l" "1" "-f" "-T" "{rev}") "0")))
@@ -506,7 +506,7 @@ Insert 'Running command' and display buffer text if COMMAND"
(defun vc-hgcmd-mode-line-string (file)
"Return a string for `vc-mode-line' to put in the mode line for FILE."
- (let* ((state (vc-state file))
+ (let* ((state (vc-state (file-relative-name file)))
(state-echo nil)
(face nil)
;; TODO allow to customize it.
@@ -551,7 +551,7 @@ Insert 'Running command' and display buffer text if COMMAND"
(defun vc-hgcmd-register (files &optional _comment)
"Register FILES."
- (apply #'vc-hgcmd-command (nconc (list "add") files)))
+ (apply #'vc-hgcmd-command (nconc (list "add") (mapcar #'file-relative-name
files))))
(defalias 'vc-hgcmd-responsible-p 'vc-hgcmd-root)
@@ -559,7 +559,7 @@ Insert 'Running command' and display buffer text if COMMAND"
(defun vc-hgcmd-unregister (file)
"Forget FILE."
- (vc-hgcmd-command "forget" file))
+ (vc-hgcmd-command "forget" (file-relative-name file)))
(declare-function log-edit-extract-headers "log-edit" (headers string))
(declare-function log-edit-toggle-header "log-edit" (header value))
@@ -583,11 +583,12 @@ Insert 'Running command' and display buffer text if
COMMAND"
("Amend" . vc-hgcmd--arg-amend)
("Close-branch" .
vc-hgcmd--arg-close-branch))
(encode-coding-string comment 'utf-8))
- files)))
+ (mapcar #'file-relative-name files))))
(defun vc-hgcmd-find-revision (file rev buffer)
"Put REV of FILE to BUFFER."
- (apply #'vc-hgcmd-command-output-buffer buffer (if rev (list "cat" "-r" rev
file) (list "cat" file))))
+ (let ((file (file-relative-name file)))
+ (apply #'vc-hgcmd-command-output-buffer buffer (if rev (list "cat" "-r"
rev file) (list "cat" file)))))
(defun vc-hgcmd-checkout (file &optional rev)
"Retrieve revision REV of FILE."
@@ -596,7 +597,7 @@ Insert 'Running command' and display buffer text if COMMAND"
(defun vc-hgcmd-revert (file &optional contents-done)
"Refert FILE if not CONTENTS-DONE."
(unless contents-done
- (vc-hgcmd-command "revert" file)))
+ (vc-hgcmd-command "revert" (file-relative-name file))))
(defun vc-hgcmd-merge-branch ()
"Merge."
@@ -623,7 +624,7 @@ Insert 'Running command' and display buffer text if COMMAND"
(defun vc-hgcmd-mark-resolved (files)
"Mark FILES resolved."
- (apply #'vc-hgcmd-command (nconc (list "resolve" "-m") files)))
+ (apply #'vc-hgcmd-command (nconc (list "resolve" "-m") (mapcar
#'file-relative-name files))))
(defun vc-hgcmd-print-log (files buffer &optional shortlog start-revision
limit)
"Put maybe SHORTLOG log of FILES to BUFFER starting with START-REVISION
limited by LIMIT."
@@ -637,7 +638,7 @@ Insert 'Running command' and display buffer text if COMMAND"
(list (if (eq limit 1) "-r" "-b") start-revision))
(when limit (list "-l" (number-to-string limit)))
(unless (or shortlog (eq limit 1)) (list "-f")) ; follow file renames
- (unless (equal files (list default-directory)) files))))
+ (unless (equal files (list default-directory)) (mapcar
#'file-relative-name files)))))
;; If limit is 1 or vc-log-show-limit then it is initial diff and better
move to working revision
;; otherwise remember point position and restore it later
(let ((p (with-current-buffer buffer (unless (or (member limit (list 1
vc-log-show-limit))) (point)))))
@@ -704,7 +705,7 @@ Insert 'Running command' and display buffer text if COMMAND"
(list "diff")
(when rev1 (list "-r" rev1))
(when rev2 (list "-r" rev2))
- (unless (equal files (list default-directory)) files))))
+ (unless (equal files (list default-directory)) (mapcar
#'file-relative-name files)))))
(apply #'vc-hgcmd-command-output-buffer buffer command)))
(defun vc-hgcmd-revision-completion-table (_files)
@@ -727,7 +728,7 @@ Insert 'Running command' and display buffer text if COMMAND"
(nconc
(list "annotate" "-qdnuf")
(when revision (list "-r" revision))
- (list file)))
+ (list (file-relative-name file))))
;; hide filenames but keep it in properties
(with-current-buffer buffer
(let ((inhibit-read-only t))
@@ -833,7 +834,7 @@ Insert 'Running command' and display buffer text if COMMAND"
(defun vc-hgcmd-delete-file (file)
"Delete FILE."
- (vc-hgcmd-command "remove" "--force" file))
+ (vc-hgcmd-command "remove" "--force" (file-relative-name file)))
(defun vc-hgcmd-rename-file (old new)
"Rename file from OLD to NEW using `hg mv'."
@@ -841,7 +842,7 @@ Insert 'Running command' and display buffer text if COMMAND"
(defun vc-hgcmd--file-unresolved-p (file)
"Return t if FILE is in conflict state."
- (let ((out (vc-hgcmd-command "resolve" "-l" file)))
+ (let ((out (vc-hgcmd-command "resolve" "-l" (file-relative-name file))))
(and out (eq (aref out 0) ?U))))
(defun vc-hgcmd--after-save-hook ()
- [elpa] externals/vc-hgcmd 088aaa4 37/87: lazy completion table on branch merge, (continued)
- [elpa] externals/vc-hgcmd 088aaa4 37/87: lazy completion table on branch merge, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 3e5782c 39/87: Handle unexpected output; Handle non-latin branch/file names, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 261ef39 21/87: version 1.3.1, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 39dddda 22/87: Use relative filename on check status, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd d9bc82c 09/87: fixed typo, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd c05d560 16/87: melpa-stable badge, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 3b2d060 17/87: Show command output on command error, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 876f7cb 20/87: Handle nil on reading parents, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 15c2c27 23/87: Communication with tty process, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 0bd38be 24/87: User parent info from summary in there are no log, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd e6f1105 25/87: Use relative file names for all commands,
Stefan Monnier <=
- [elpa] externals/vc-hgcmd f093b75 34/87: Message if hg command is running when running another, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd f92c39b 40/87: Fixed regexp, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 323b4ab 41/87: Option to skip data on error channel, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd d439b43 42/87: Running command indicator in output buffer mode line, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 3f8c60b 45/87: Create output buffer before actually running command, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 6379ef2 50/87: process-environment order, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd f87a21d 54/87: next/previous revison respects files, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd adb7cb5 11/87: directories are always registered, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd d30560d 14/87: Melpa badge, Stefan Monnier, 2021/06/05
- [elpa] externals/vc-hgcmd 7e4fc39 19/87: Custom function to edit initial commit message, Stefan Monnier, 2021/06/05