canonpath: fix infinite recursion
authorMatt Mackall <mpm@selenic.com>
Tue, 12 May 2015 19:40:45 -0500
changeset 25022 10bbdcd89164
parent 25021 9a74b9919581
child 25023 405cb38448ad
canonpath: fix infinite recursion
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