Show More
@@ -152,7 +152,17 b' def canonpath(root, cwd, myname, auditor' | |||||
152 | break |
|
152 | break | |
153 | name = dirname |
|
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 | def normasprefix(path): |
|
167 | def normasprefix(path): | |
158 | '''normalize the specified path as path prefix |
|
168 | '''normalize the specified path as path prefix |
@@ -88,6 +88,7 b' Implicit -R:' | |||||
88 | [255] |
|
88 | [255] | |
89 | $ hg -R b ann a/a |
|
89 | $ hg -R b ann a/a | |
90 | abort: a/a not under root '$TESTTMP/b' (glob) |
|
90 | abort: a/a not under root '$TESTTMP/b' (glob) | |
|
91 | (consider using '--cwd b') | |||
91 | [255] |
|
92 | [255] | |
92 | $ hg log |
|
93 | $ hg log | |
93 |
abort: no repository found in '$ |
|
94 | abort: no repository found in '$TESTTMP' (.hg not found)! |
General Comments 0
You need to be logged in to leave comments.
Login now