diff --git a/hgext3rd/sparse.py b/hgext3rd/sparse.py --- a/hgext3rd/sparse.py +++ b/hgext3rd/sparse.py @@ -763,7 +763,7 @@ raise error.Abort(err) if (not ui.configbool('sparse', 'includereporootpaths', False) - and (include or exclude)): + and (include or exclude or delete)): # supplied file patterns should be treated as relative # to current working dir, so we need to convert them first pats = scmutil.match(repo['.'], pats).files() diff --git a/tests/test-sparse.t b/tests/test-sparse.t --- a/tests/test-sparse.t +++ b/tests/test-sparse.t @@ -53,6 +53,30 @@ $ cd .. $ rm -rf subdir +Verify deleting uses relative paths + $ mkdir subdir && echo foo > subdir/foo + $ hg sparse + [include] + $TESTTMP/myrepo/hide + hide + reporoot/path + subdir/cwd/path + [exclude] + + + $ cd subdir + $ hg sparse --delete cwd/path + $ hg sparse + [include] + $TESTTMP/myrepo/hide + hide + reporoot/path + [exclude] + + + $ cd .. + $ rm -rf subdir + Verify commiting while sparse includes other files $ echo z > hide