tests/test-casecollision.t
author Sandu Turcan <idlsoft@gmail.com>
Tue, 03 May 2022 21:44:30 -0400
branchstable
changeset 49241 6b10151b9621
parent 48367 0b8e076e878c
permissions -rw-r--r--
narrow_widen_acl: enforce narrowacl in narrow_widen (SEC) Reviewer note: this was sent by the author as a simple bugfix, but can be considered a security patch, since it allows users to access things outside of the ACL, hence the (SEC) prefix. However, this affects the `narrow` extention which is still marked as experimental and has relatively few users aside from large companies with their own security layers on top from what we can gather. We feel (Alphare: or at least, I feel) like pinging the packaging list is enough in this case.

#require no-icasefs

test file addition with colliding case

  $ hg init repo1
  $ cd repo1
  $ echo a > a
  $ echo A > A
  $ hg add a
  $ hg st
  A a
  ? A
  $ hg add --config ui.portablefilenames=abort A
  abort: possible case-folding collision for A
  [20]
  $ hg st
  A a
  ? A
  $ hg add A
  warning: possible case-folding collision for A
  $ hg st
  A A
  A a
  $ hg forget A
  $ hg st
  A a
  ? A
  $ hg add --config ui.portablefilenames=no A
  $ hg st
  A A
  A a
  $ mkdir b
  $ touch b/c b/D
  $ hg add b
  adding b/D
  adding b/c
  $ touch b/d b/C
  $ hg add b/C
  warning: possible case-folding collision for b/C
  $ hg add b/d
  warning: possible case-folding collision for b/d
  $ touch b/a1 b/a2
  $ hg add b
  adding b/a1
  adding b/a2
  $ touch b/A2 b/a1.1
  $ hg add b/a1.1 b/A2
  warning: possible case-folding collision for b/A2
  $ touch b/f b/F
  $ hg add b/f b/F
  warning: possible case-folding collision for b/f
  $ touch g G
  $ hg add g G
  warning: possible case-folding collision for g
  $ mkdir h H
  $ touch h/x H/x
  $ hg add h/x H/x
  warning: possible case-folding collision for h/x
  $ touch h/s H/s
  $ hg add h/s
  $ hg add H/s
  warning: possible case-folding collision for H/s

case changing rename must not warn or abort

  $ echo c > c
  $ hg ci -qAmx
  $ hg mv c C
  $ cd ..