tests/test-execute-bit.t
author Simon Sapin <simon.sapin@octobus.net>
Tue, 09 Nov 2021 19:55:46 +0100
changeset 48335 b7fde9237c92
parent 22046 7a9cbb315d84
child 48345 d5a91701f7dc
permissions -rw-r--r--
rhg: Enable `rhg status` in most tests This subcommand is disabled by default because of bugs that make some test fail. Enable it in the rest of the tests in order to avoid regressing them. As with `RHG_ON_UNSUPPORTED`, an environment variable is used instead of a configuration file and `HGRCPATH` because some tests override `HGRCPATH`. Running `unset RHG_STATUS` at the start of a test restores the default of `rhg status` being disabled. Hopefully it can be increasingly removed from test files as bugs are fixed. Differential Revision: https://phab.mercurial-scm.org/D11756
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22046
7a9cbb315d84 tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents: 18334
diff changeset
     1
#require execbit
5490
bf2bb53e5d2b See if execute bit is honoured when we go back in time
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     2
48335
b7fde9237c92 rhg: Enable `rhg status` in most tests
Simon Sapin <simon.sapin@octobus.net>
parents: 22046
diff changeset
     3
TODO: fix rhg bugs that make this test fail when status is enabled
b7fde9237c92 rhg: Enable `rhg status` in most tests
Simon Sapin <simon.sapin@octobus.net>
parents: 22046
diff changeset
     4
  $ unset RHG_STATUS
b7fde9237c92 rhg: Enable `rhg status` in most tests
Simon Sapin <simon.sapin@octobus.net>
parents: 22046
diff changeset
     5
b7fde9237c92 rhg: Enable `rhg status` in most tests
Simon Sapin <simon.sapin@octobus.net>
parents: 22046
diff changeset
     6
12190
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
     7
  $ hg init
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
     8
  $ echo a > a
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
     9
  $ hg ci -Am'not executable'
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    10
  adding a
5495
363ba35f55bd test-execute-bit: skip if execute-bit is not supported
Patrick Mezard <pmezard@gmail.com>
parents: 5490
diff changeset
    11
12190
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    12
  $ chmod +x a
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    13
  $ hg ci -m'executable'
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    14
  $ hg id
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    15
  79abf14474dc tip
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    16
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    17
Make sure we notice the change of mode if the cached size == -1:
5490
bf2bb53e5d2b See if execute bit is honoured when we go back in time
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    18
12190
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    19
  $ hg rm a
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    20
  $ hg revert -r 0 a
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    21
  $ hg debugstate
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    22
  n   0         -1 unset               a
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    23
  $ hg status
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    24
  M a
5490
bf2bb53e5d2b See if execute bit is honoured when we go back in time
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    25
12190
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    26
  $ hg up 0
18334
44bda93df90e merge: changing the mode of a file is also an update
Mads Kiilerich <mads@kiilerich.com>
parents: 12190
diff changeset
    27
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12190
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    28
  $ hg id
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    29
  d69afc33ff8a
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    30
  $ test -x a && echo executable -- bad || echo not executable -- good
9231c629ec10 tests: unify test-execute-bit
Adrian Buehlmann <adrian@cadifra.com>
parents: 6158
diff changeset
    31
  not executable -- good
6158
23ffe82615d8 repo.status: also compare flags for files in the lookup list.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5495
diff changeset
    32