tests/test-admin-commands.t
author Matt Harbison <matt_harbison@yahoo.com>
Wed, 21 Aug 2024 16:13:14 -0400
changeset 51820 71fb6e0a7a35
parent 50989 752c5a5b73c6
permissions -rw-r--r--
typing: add type hints to the `opener` attributes and arguments of revlog When making revlog and filelog classes visible to pytype, it got confused quite a bit in `mercurial/revlogutils/rewrite.py`, thinking it had a plain `Callable`, and flagging additional methods on it like `join()` and `rename()`. I couldn't figure out how it reduced to that (and PyCharm flagged `opener` references as `Any`), but this makes it happy. So make this change before making the classes visible. The vfs class hierarchy is a bit wonky (e.g. `filteredvfs` is not a `vfs`), so this may need to be revisited with a Protocol class that covers all of the `vfs` classes. But for now, everything works.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50989
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     1
Test admin::verify
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     2
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     3
  $ hg init admin-verify
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     4
  $ cd admin-verify
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     5
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     6
Test normal output
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     7
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     8
  $ hg admin::verify -c dirstate
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
     9
  running 1 checks
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    10
  running working-copy.dirstate
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    11
  checking dirstate
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    12
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    13
Quiet works
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    14
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    15
  $ hg admin::verify -c dirstate --quiet
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    16
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    17
Test no check no options
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    18
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    19
  $ hg admin::verify
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    20
  abort: `checks` required
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    21
  [255]
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    22
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    23
Test single check without options
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    24
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    25
  $ hg admin::verify -c working-copy.dirstate
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    26
  running 1 checks
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    27
  running working-copy.dirstate
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    28
  checking dirstate
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    29
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    30
Test single check (alias) without options
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    31
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    32
  $ hg admin::verify -c dirstate
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    33
  running 1 checks
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    34
  running working-copy.dirstate
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    35
  checking dirstate
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    36
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    37
Test wrong check name without options
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    38
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    39
  $ hg admin::verify -c working-copy.dir
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    40
  abort: unknown check working-copy.dir
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    41
  (did you mean working-copy.dirstate?)
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    42
  [10]
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    43
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    44
Test wrong alias without options
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    45
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    46
  $ hg admin::verify -c dir
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    47
  abort: unknown check dir
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    48
  [10]
752c5a5b73c6 admin-command: add verify command
Raphaël Gomès <rgomes@octobus.net>
parents:
diff changeset
    49