diff options
| author | Tassilo Horn | 2020-06-15 08:56:11 +0200 |
|---|---|---|
| committer | Tassilo Horn | 2020-06-15 08:56:11 +0200 |
| commit | 2e80328ba683e6205cd65bd3fb69da2563183e66 (patch) | |
| tree | 502f9c2c403f784b3d73c2da47e291eef1f2e4ac | |
| parent | 4f92cf14f395577572d451c0488ade952bc3cbaa (diff) | |
| download | emacs-2e80328ba683e6205cd65bd3fb69da2563183e66.tar.gz emacs-2e80328ba683e6205cd65bd3fb69da2563183e66.zip | |
Add optional remote-name argument to VC repository-url command
* lisp/vc/vc.el: Document new remote-name argument of VC
repository-url command.
* lisp/vc/vc-git.el (vc-git-repository-url): Add and use new arg.
* lisp/vc/vc-hg.el (vc-hg-repository-url): Add and use new arg.
* lisp/vc/vc-bzr.el (vc-bzr-repository-url): Add new arg but ignore
it.
* lisp/vc/vc-svn.el (vc-svn-repository-url): Add new arg but ignore
it.
| -rw-r--r-- | lisp/vc/vc-bzr.el | 2 | ||||
| -rw-r--r-- | lisp/vc/vc-git.el | 5 | ||||
| -rw-r--r-- | lisp/vc/vc-hg.el | 5 | ||||
| -rw-r--r-- | lisp/vc/vc-svn.el | 2 | ||||
| -rw-r--r-- | lisp/vc/vc.el | 7 |
5 files changed, 13 insertions, 8 deletions
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 21c7e7cfab1..f98730ed221 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el | |||
| @@ -1316,7 +1316,7 @@ stream. Standard error output is discarded." | |||
| 1316 | vc-bzr-revision-keywords)) | 1316 | vc-bzr-revision-keywords)) |
| 1317 | string pred))))) | 1317 | string pred))))) |
| 1318 | 1318 | ||
| 1319 | (defun vc-bzr-repository-url (file-or-dir) | 1319 | (defun vc-bzr-repository-url (file-or-dir &optional _remote-name) |
| 1320 | (let ((default-directory (vc-bzr-root file-or-dir))) | 1320 | (let ((default-directory (vc-bzr-root file-or-dir))) |
| 1321 | (with-temp-buffer | 1321 | (with-temp-buffer |
| 1322 | (vc-bzr-command "info" (current-buffer) 0 nil) | 1322 | (vc-bzr-command "info" (current-buffer) 0 nil) |
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 261e4c7aa47..636f9dfd0ca 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el | |||
| @@ -1083,10 +1083,11 @@ This prompts for a branch to merge from." | |||
| 1083 | "DU" "AA" "UU")) | 1083 | "DU" "AA" "UU")) |
| 1084 | (push (expand-file-name file directory) files))))))) | 1084 | (push (expand-file-name file directory) files))))))) |
| 1085 | 1085 | ||
| 1086 | (defun vc-git-repository-url (file-or-dir) | 1086 | (defun vc-git-repository-url (file-or-dir &optional remote-name) |
| 1087 | (let ((default-directory (vc-git-root file-or-dir))) | 1087 | (let ((default-directory (vc-git-root file-or-dir))) |
| 1088 | (with-temp-buffer | 1088 | (with-temp-buffer |
| 1089 | (vc-git-command (current-buffer) 0 nil "remote" "get-url" "origin") | 1089 | (vc-git-command (current-buffer) 0 nil "remote" "get-url" |
| 1090 | (or remote-name "origin")) | ||
| 1090 | (buffer-substring-no-properties (point-min) (1- (point-max)))))) | 1091 | (buffer-substring-no-properties (point-min) (1- (point-max)))))) |
| 1091 | 1092 | ||
| 1092 | ;; Everywhere but here, follows vc-git-command, which uses vc-do-command | 1093 | ;; Everywhere but here, follows vc-git-command, which uses vc-do-command |
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 25ca4ed55fd..95ced7b8d09 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el | |||
| @@ -1525,11 +1525,12 @@ This function differs from vc-do-command in that it invokes | |||
| 1525 | (defun vc-hg-root (file) | 1525 | (defun vc-hg-root (file) |
| 1526 | (vc-find-root file ".hg")) | 1526 | (vc-find-root file ".hg")) |
| 1527 | 1527 | ||
| 1528 | (defun vc-hg-repository-url (file-or-dir) | 1528 | (defun vc-hg-repository-url (file-or-dir &optional remote-name) |
| 1529 | (let ((default-directory (vc-hg-root file-or-dir))) | 1529 | (let ((default-directory (vc-hg-root file-or-dir))) |
| 1530 | (with-temp-buffer | 1530 | (with-temp-buffer |
| 1531 | (vc-hg-command (current-buffer) 0 nil | 1531 | (vc-hg-command (current-buffer) 0 nil |
| 1532 | "config" "paths.default") | 1532 | "config" |
| 1533 | (concat "paths." (or remote-name "default"))) | ||
| 1533 | (buffer-substring-no-properties (point-min) (1- (point-max)))))) | 1534 | (buffer-substring-no-properties (point-min) (1- (point-max)))))) |
| 1534 | 1535 | ||
| 1535 | (provide 'vc-hg) | 1536 | (provide 'vc-hg) |
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 6ab07c1476d..e108b3a340f 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el | |||
| @@ -818,7 +818,7 @@ Set file properties accordingly. If FILENAME is non-nil, return its status." | |||
| 818 | (setq loglines (buffer-substring-no-properties start (point-max))))) | 818 | (setq loglines (buffer-substring-no-properties start (point-max))))) |
| 819 | vc-svn-revisions))) | 819 | vc-svn-revisions))) |
| 820 | 820 | ||
| 821 | (defun vc-svn-repository-url (file-or-dir) | 821 | (defun vc-svn-repository-url (file-or-dir &optional _remote-name) |
| 822 | (let ((default-directory (vc-svn-root file-or-dir))) | 822 | (let ((default-directory (vc-svn-root file-or-dir))) |
| 823 | (with-temp-buffer | 823 | (with-temp-buffer |
| 824 | (vc-svn-command (current-buffer) 0 nil | 824 | (vc-svn-command (current-buffer) 0 nil |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 5c335ebfaa2..ce947d21f95 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -554,9 +554,12 @@ | |||
| 554 | ;; the project that contains DIR. | 554 | ;; the project that contains DIR. |
| 555 | ;; FIXME: what should it do with non-text conflicts? | 555 | ;; FIXME: what should it do with non-text conflicts? |
| 556 | ;; | 556 | ;; |
| 557 | ;; - repository-url (file) | 557 | ;; - repository-url (file-or-dir &optional remote-name) |
| 558 | ;; | 558 | ;; |
| 559 | ;; Returns the URL of the repository of the current checkout. | 559 | ;; Returns the URL of the repository of the current checkout |
| 560 | ;; containing FILE-OR-DIR. The optional REMOTE-NAME specifies the | ||
| 561 | ;; remote (in Git parlance) whose URL is to be returned. It has | ||
| 562 | ;; only a meaning for distributed VCS and is ignored otherwise. | ||
| 560 | 563 | ||
| 561 | ;;; Changes from the pre-25.1 API: | 564 | ;;; Changes from the pre-25.1 API: |
| 562 | ;; | 565 | ;; |