# HG changeset patch # User Matt Mackall # Date 1431477645 18000 # Node ID 10bbdcd8916436f65aa0217b672528acaa0b3db8 # Parent 9a74b991958174460bf113ec5ddc74f85ee5a640 canonpath: fix infinite recursion diff -r 9a74b9919581 -r 10bbdcd89164 mercurial/pathutil.py --- a/mercurial/pathutil.py Tue May 12 11:44:14 2015 -0700 +++ b/mercurial/pathutil.py Tue May 12 19:40:45 2015 -0500 @@ -156,8 +156,10 @@ # 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