# HG changeset patch # User Matt Mackall # Date 2015-05-13 00:40:45 # Node ID 10bbdcd8916436f65aa0217b672528acaa0b3db8 # Parent 9a74b991958174460bf113ec5ddc74f85ee5a640 canonpath: fix infinite recursion diff --git a/mercurial/pathutil.py b/mercurial/pathutil.py --- a/mercurial/pathutil.py +++ b/mercurial/pathutil.py @@ -156,8 +156,10 @@ def canonpath(root, cwd, myname, auditor # instead of cwd. Detect that case, and provide a hint to the user. hint = None try: - canonpath(root, root, myname, auditor) - hint = _("consider using '--cwd %s'") % os.path.relpath(root, cwd) + if cwd != root: + canonpath(root, root, myname, auditor) + hint = (_("consider using '--cwd %s'") + % os.path.relpath(root, cwd)) except util.Abort: pass