tests/test-strict.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Fri, 15 Mar 2024 01:31:57 +0100
branchstable
changeset 51505 c9ceb4f60256
parent 49621 55c6ebd11cb9
permissions -rw-r--r--
phases: avoid N² behavior in `advanceboundary` We allowed duplicated entries in the deque, which each entry could potentially insert all its ancestors. So advancing boundary for the full repository would mean each revision would walk all its ancestors, resulting in O(N²) iteration. For repository of any decent size, N² is quickly insane. We introduce a simple set to avoid this and get back to reasonable performance.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 46262
diff changeset
     1
  $ hg init repo
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 46262
diff changeset
     2
  $ cd repo
2988
63c3a1921a67 Add ui.strict config item.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     3
12097
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     4
  $ echo a > a
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     5
  $ hg ci -Ama
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     6
  adding a
2988
63c3a1921a67 Add ui.strict config item.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     7
12097
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     8
  $ hg an a
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
     9
  0: a
2988
63c3a1921a67 Add ui.strict config item.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    10
16591
46e9ed223d2c commands: parse ui.strict config item as bool
Yuya Nishihara <yuya@tcha.org>
parents: 15862
diff changeset
    11
  $ hg --config ui.strict=False an a
46e9ed223d2c commands: parse ui.strict config item as bool
Yuya Nishihara <yuya@tcha.org>
parents: 15862
diff changeset
    12
  0: a
46e9ed223d2c commands: parse ui.strict config item as bool
Yuya Nishihara <yuya@tcha.org>
parents: 15862
diff changeset
    13
12097
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    14
  $ echo "[ui]" >> $HGRCPATH
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    15
  $ echo "strict=True" >> $HGRCPATH
2988
63c3a1921a67 Add ui.strict config item.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    16
12097
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    17
  $ hg an a
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    18
  hg: unknown command 'an'
38787
5199c5b6fd29 dispatch: don't show list of commands on bogus command
Martin von Zweigbergk <martinvonz@google.com>
parents: 29974
diff changeset
    19
  (use 'hg help' for a list of commands)
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 38787
diff changeset
    20
  [10]
12097
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    21
  $ hg annotate a
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    22
  0: a
2988
63c3a1921a67 Add ui.strict config item.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    23
12097
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    24
should succeed - up is an alias, not an abbreviation
2988
63c3a1921a67 Add ui.strict config item.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    25
12097
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    26
  $ hg up
389c215885c5 tests: unify test-strict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
    27
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved