diff --git a/hgext3rd/sparse.py b/hgext3rd/sparse.py --- a/hgext3rd/sparse.py +++ b/hgext3rd/sparse.py @@ -758,10 +758,9 @@ newexclude = set(oldexclude) newprofiles = set(oldprofiles) - if any(pat.startswith('/') for pat in pats): - err = _('paths cannot start with /') - hint = _('do not use absolute paths') - raise error.Abort(err, hint=hint) + if any(os.path.isabs(pat) for pat in pats): + err = _('paths cannot be absolute') + raise error.Abort(err) if (not ui.configbool('sparse', 'includereporootpaths', False) and (include or exclude)): diff --git a/tests/test-sparse.t b/tests/test-sparse.t --- a/tests/test-sparse.t +++ b/tests/test-sparse.t @@ -28,14 +28,12 @@ Absolute paths outside the repo should just be rejected $ hg sparse --include /foo/bar - abort: paths cannot start with / - (do not use absolute paths) + abort: paths cannot be absolute [255] $ hg sparse --include '$TESTTMP/myrepo/hide' $ hg sparse --include '/root' - abort: paths cannot start with / - (do not use absolute paths) + abort: paths cannot be absolute [255] Repo root-relaive vs. cwd-relative includes