mercurial/pathutil.py
changeset 25022 10bbdcd89164
parent 25011 7d6a507a4c53
child 25281 660b178f49c7
equal deleted inserted replaced
25021:9a74b9919581 25022:10bbdcd89164
   154 
   154 
   155         # A common mistake is to use -R, but specify a file relative to the repo
   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.
   156         # instead of cwd.  Detect that case, and provide a hint to the user.
   157         hint = None
   157         hint = None
   158         try:
   158         try:
   159             canonpath(root, root, myname, auditor)
   159             if cwd != root:
   160             hint = _("consider using '--cwd %s'") % os.path.relpath(root, cwd)
   160                 canonpath(root, root, myname, auditor)
       
   161                 hint = (_("consider using '--cwd %s'")
       
   162                         % os.path.relpath(root, cwd))
   161         except util.Abort:
   163         except util.Abort:
   162             pass
   164             pass
   163 
   165 
   164         raise util.Abort(_("%s not under root '%s'") % (myname, root),
   166         raise util.Abort(_("%s not under root '%s'") % (myname, root),
   165                          hint=hint)
   167                          hint=hint)