Mercurial > public > mercurial-scm > hg-stable
diff tests/test-commit.t @ 23599:6dad422ecc5a stable 3.2.3
pathauditor: check for Windows shortname aliases
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 18 Dec 2014 14:18:28 -0600 |
parents | c02a05cc6f5e |
children | a4679a74df14 |
line wrap: on
line diff
--- a/tests/test-commit.t Tue Dec 16 13:08:17 2014 -0500 +++ b/tests/test-commit.t Thu Dec 18 14:18:28 2014 -0600 @@ -474,4 +474,38 @@ abort: path contains illegal component: .h\xe2\x80\x8cg/hgrc (esc) [255] - $ cd .. + $ hg rollback -f + repository tip rolled back to revision 1 (undo commit) + $ cat > evil-commit.py <<EOF + > from mercurial import ui, hg, context, node + > notrc = "HG~1/hgrc" + > u = ui.ui() + > r = hg.repository(u, '.') + > def filectxfn(repo, memctx, path): + > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > c = context.memctx(r, [r['tip'].node(), node.nullid], + > 'evil', [notrc], filectxfn, 0) + > r.commitctx(c) + > EOF + $ $PYTHON evil-commit.py + $ hg co --clean tip + abort: path contains illegal component: HG~1/hgrc + [255] + + $ hg rollback -f + repository tip rolled back to revision 1 (undo commit) + $ cat > evil-commit.py <<EOF + > from mercurial import ui, hg, context, node + > notrc = "HG8B6C~2/hgrc" + > u = ui.ui() + > r = hg.repository(u, '.') + > def filectxfn(repo, memctx, path): + > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > c = context.memctx(r, [r['tip'].node(), node.nullid], + > 'evil', [notrc], filectxfn, 0) + > r.commitctx(c) + > EOF + $ $PYTHON evil-commit.py + $ hg co --clean tip + abort: path contains illegal component: HG8B6C~2/hgrc + [255]