tests/test-execute-bit.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Wed, 13 Nov 2013 15:55:30 +0900
changeset 20176 4c96c50ef937
parent 18334 44bda93df90e
child 22046 7a9cbb315d84
permissions -rw-r--r--
subrepo: check phase of state in each subrepositories before committing Before this patch, phase of newly created commit is determined by "phases.new-commit" configuration regardless of phase of state in each subrepositories. For example, this may cause the "public" revision in the parent repository referring the "secret" one in subrepository. This patch checks phase of state in each subrepositories before committing in the parent, and aborts or changes phase of newly created commit if subrepositories have more restricted phase than the parent. This patch uses "follow" as default value of "phases.checksubrepos" configuration, because it can keep consistency between phases of the parent and subrepositories without breaking existing tool chains.

  $ "$TESTDIR/hghave" execbit || exit 80

  $ hg init
  $ echo a > a
  $ hg ci -Am'not executable'
  adding a

  $ chmod +x a
  $ hg ci -m'executable'
  $ hg id
  79abf14474dc tip

Make sure we notice the change of mode if the cached size == -1:

  $ hg rm a
  $ hg revert -r 0 a
  $ hg debugstate
  n   0         -1 unset               a
  $ hg status
  M a

  $ hg up 0
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ hg id
  d69afc33ff8a
  $ test -x a && echo executable -- bad || echo not executable -- good
  not executable -- good