mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
mercurial.el: add hg-cwd
This commit is contained in:
parent
9447cded78
commit
01df2e50e5
@ -1211,6 +1211,21 @@ prompts for a path to check."
|
||||
root)
|
||||
hg-root))
|
||||
|
||||
(defun hg-cwd (&optional path)
|
||||
"Return the current directory of PATH within the repository."
|
||||
(do ((stack nil (cons (file-name-nondirectory
|
||||
(directory-file-name dir))
|
||||
stack))
|
||||
(prev nil dir)
|
||||
(dir (file-name-directory (or path buffer-file-name
|
||||
(expand-file-name default-directory)))
|
||||
(file-name-directory (directory-file-name dir))))
|
||||
((equal prev dir))
|
||||
(when (file-directory-p (concat dir ".hg"))
|
||||
(let ((cwd (mapconcat 'identity stack "/")))
|
||||
(unless (equal cwd "")
|
||||
(return (file-name-as-directory cwd)))))))
|
||||
|
||||
(defun hg-status (path)
|
||||
"Print revision control status of a file or directory.
|
||||
With prefix argument, prompt for the path to give status for.
|
||||
|
Loading…
Reference in New Issue
Block a user