comparison contrib/mercurial.el @ 2876:0ffca0cb9f4b

Use cached hg-root-dir instead of rediscovering by a second call to (hg-root). We have the path we need already as the value of hg-root-dir.
author Giorgos Keramidas <keramida@ceid.upatras.gr>
date Sun, 13 Aug 2006 20:21:13 +0300
parents a5c43944e1ee
children 48baf9fb1921
comparison
equal deleted inserted replaced
2875:cf86bbb8ed68 2876:0ffca0cb9f4b
720 (delete-region pos (point))) 720 (delete-region pos (point)))
721 (let ((hg-root-dir (hg-root))) 721 (let ((hg-root-dir (hg-root)))
722 (if (not hg-root-dir) 722 (if (not hg-root-dir)
723 (error "error: %s: directory is not part of a Mercurial repository." 723 (error "error: %s: directory is not part of a Mercurial repository."
724 default-directory) 724 default-directory)
725 (cd (hg-root)))))) 725 (cd hg-root-dir)))))
726 726
727 (defun hg-add (path) 727 (defun hg-add (path)
728 "Add PATH to the Mercurial repository on the next commit. 728 "Add PATH to the Mercurial repository on the next commit.
729 With a prefix argument, prompt for the path to add." 729 With a prefix argument, prompt for the path to add."
730 (interactive (list (hg-read-file-name " to add"))) 730 (interactive (list (hg-read-file-name " to add")))