tests/test-requires.t
author Matt Mackall <mpm@selenic.com>
Sun, 23 Oct 2011 16:32:27 -0500
branchstable
changeset 15348 c681e478c429
parent 14746 72e4fcb43227
child 16913 f2719b387380
permissions -rw-r--r--
windows: sanity-check symlink placeholders On Windows, we store symlinks as plain files with the link contents. Via user error or NFS/Samba assistance, these files often end up with 'normal' file contents. Committing these changes thus gives an invalid symlink that can't be checked out on Unix. Here we filter out any modified symlink placeholders that look suspicious when computing status: - more than 1K (looks more like a normal file) - contain NULs (not allowed on Unix, probably a binary) - contains \n (filenames can't contain \n, very unusual for symlinks, very common for files)

  $ hg init t
  $ cd t
  $ echo a > a
  $ hg add a
  $ hg commit -m test
  $ rm .hg/requires
  $ hg tip
  abort: index 00changelog.i unknown format 2!
  [255]
  $ echo indoor-pool > .hg/requires
  $ hg tip
  abort: unknown repository format: requires features 'indoor-pool' (upgrade Mercurial)!
  [255]
  $ echo outdoor-pool >> .hg/requires
  $ hg tip
  abort: unknown repository format: requires features 'indoor-pool', 'outdoor-pool' (upgrade Mercurial)!
  [255]