# HG changeset patch # User Giorgos Keramidas # Date 1154241428 -10800 # Node ID a5c43944e1eef3362d58767d0cf76bae5d26e100 # Parent eb1bde9560bc1b031eccc4640b46cf902795c290 avoid calling (cd ...) with `nil' as a directory name When (hg-root) cannot determine the current Mercurial root, print an error message instead of trying to evaluate (cd nil). diff -r eb1bde9560bc -r a5c43944e1ee contrib/mercurial.el --- a/contrib/mercurial.el Sat Jul 29 18:15:08 2006 +0200 +++ b/contrib/mercurial.el Sun Jul 30 09:37:08 2006 +0300 @@ -718,7 +718,11 @@ (goto-char pos) (end-of-line 1) (delete-region pos (point))) - (cd (hg-root)))) + (let ((hg-root-dir (hg-root))) + (if (not hg-root-dir) + (error "error: %s: directory is not part of a Mercurial repository." + default-directory) + (cd (hg-root)))))) (defun hg-add (path) "Add PATH to the Mercurial repository on the next commit.