diff mercurial/pathutil.py @ 25022:10bbdcd89164

canonpath: fix infinite recursion
author Matt Mackall <mpm@selenic.com>
date Tue, 12 May 2015 19:40:45 -0500
parents 7d6a507a4c53
children 660b178f49c7
line wrap: on
line diff
--- 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