tests/test-backwards-remove.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Fri, 03 Jul 2015 06:56:03 +0900
changeset 25732 b94df10cc3b5
parent 12156 4c94b6d0fb1c
child 44724 5c2a4f37eace
permissions -rw-r--r--
hghave: allow adding customized features at runtime Before this patch, there is no way to add customized features to `hghave` without changing `hghave` and `hghave.py` themselves. This decreases reusability of `run-tests.py` framework for third party tools, because they may want to examine custom features at runtime (e.g. existence of some external tools). To allow adding customized features at runtime, this patch makes `hghave` import `hghaveaddon` module, only when `hghaveaddon.py` file can be found in directories below: - `TESTDIR` for invocation via `run-tests.py` - `.` for invocation via command line The path to the directory where `hghaveaddon.py` should be placed is added to `sys.path` only while importing `hghaveaddon`, because: - `.` may not be added to `PYTHONPATH` - adding additional path to `sys.path` may change behavior of subsequent `import` for other features `hghave` is terminated with exit code '2' at failure of `import hghaveaddon`, because exit code '2' terminates `run-tests.py` immediately. This is a one of preparations for issue4677.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11857
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
     1
  $ hg init
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
     2
  $ echo This is file a1 > a
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
     3
  $ hg add a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11857
diff changeset
     4
  $ hg commit -m "commit #0"
11857
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
     5
  $ ls
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
     6
  a
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
     7
  $ echo This is file b1 > b
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
     8
  $ hg add b
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11857
diff changeset
     9
  $ hg commit -m "commit #1"
11857
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
    10
  $ hg co 0
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
    11
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
    12
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
    13
B should disappear
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
    14
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
    15
  $ ls
9661514f85ae tests: unify test-backwards-remove
Martin Geisler <mg@lazybytes.net>
parents: 1933
diff changeset
    16
  a