##// END OF EJS Templates
pathutil: hint if a path is root relative instead of cwd relative (issue4663)...
Matt Harbison -
r25011:7d6a507a default
parent child Browse files
Show More
@@ -152,7 +152,17 b' def canonpath(root, cwd, myname, auditor'
152 152 break
153 153 name = dirname
154 154
155 raise util.Abort(_("%s not under root '%s'") % (myname, root))
155 # A common mistake is to use -R, but specify a file relative to the repo
156 # instead of cwd. Detect that case, and provide a hint to the user.
157 hint = None
158 try:
159 canonpath(root, root, myname, auditor)
160 hint = _("consider using '--cwd %s'") % os.path.relpath(root, cwd)
161 except util.Abort:
162 pass
163
164 raise util.Abort(_("%s not under root '%s'") % (myname, root),
165 hint=hint)
156 166
157 167 def normasprefix(path):
158 168 '''normalize the specified path as path prefix
@@ -88,6 +88,7 b' Implicit -R:'
88 88 [255]
89 89 $ hg -R b ann a/a
90 90 abort: a/a not under root '$TESTTMP/b' (glob)
91 (consider using '--cwd b')
91 92 [255]
92 93 $ hg log
93 94 abort: no repository found in '$TESTTMP' (.hg not found)!
General Comments 0
You need to be logged in to leave comments. Login now