tests/test-identify.t
author Adrian Buehlmann <adrian@cadifra.com>
Sun, 21 Nov 2010 11:52:27 +0100
changeset 13026 53391819f195
parent 12346 3b165c127690
child 13447 931a72e00efa
permissions -rw-r--r--
check-code: catch Python 'is' comparing number or string literals The Python 'is' operator compares object identity, so it should definitely not be applied to string or number literals, which Python implementations are free to represent with a temporary object. This should catch the following kinds of bogus expressions (examples): x is 'foo' x is not 'foo' x is "bar" x is not "bar" x is 42 x is not 42 x is -36 x is not -36 As originally proposed by Martin Geisler, amended with catching negative numbers.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
     1
  $ "$TESTDIR/hghave" no-outer-repo || exit 80
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
     2
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
     3
no repo
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     4
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
     5
  $ hg id
12070
fddacca3202e Merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 11796
diff changeset
     6
  abort: there is no Mercurial repository here (.hg not found)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12070
diff changeset
     7
  [255]
7830
55bd03e2e13c test-identify: require no-outer-repo
Mads Kiilerich <mads@kiilerich.com>
parents: 7759
diff changeset
     8
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
     9
create repo
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    10
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    11
  $ hg init test
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    12
  $ cd test
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    13
  $ echo a > a
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    14
  $ hg ci -Ama
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    15
  adding a
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    16
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    17
basic id usage
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    18
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    19
  $ hg id
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    20
  cb9a9f314b8b tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    21
  $ hg id --debug
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    22
  cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    23
  $ hg id -q
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    24
  cb9a9f314b8b
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    25
  $ hg id -v
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    26
  cb9a9f314b8b tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    27
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    28
with options
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    29
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    30
  $ hg id -r.
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    31
  cb9a9f314b8b tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    32
  $ hg id -n
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    33
  0
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    34
  $ hg id -t
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    35
  tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    36
  $ hg id -b
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    37
  default
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    38
  $ hg id -i
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    39
  cb9a9f314b8b
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    40
  $ hg id -n -t -b -i
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    41
  cb9a9f314b8b 0 default tip
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    42
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    43
with modifications
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    44
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    45
  $ echo b > a
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    46
  $ hg id -n -t -b -i
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    47
  cb9a9f314b8b+ 0+ default tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    48
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    49
other local repo
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    50
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    51
  $ cd ..
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    52
  $ hg -R test id
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    53
  cb9a9f314b8b+ tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    54
  $ hg id test
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    55
  cb9a9f314b8b+ tip
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    56
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    57
with remote http repo
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    58
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    59
  $ cd test
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    60
  $ hg serve -p $HGPORT1 -d --pid-file=hg.pid
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    61
  $ cat hg.pid >> $DAEMON_PIDS
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    62
  $ hg id http://localhost:$HGPORT1/
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    63
  cb9a9f314b8b
7757
af6a63438a8a identify: have consistent output for local repositories
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    64
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    65
remote with tags?
7759
50baf8215942 tests: fix for test-identify returning 255
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 7757
diff changeset
    66
11796
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    67
  $ hg id -t http://localhost:$HGPORT1/
141e2e964705 tests: unify test-identify
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 7830
diff changeset
    68
  abort: can't query remote revision number, branch, or tags
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12070
diff changeset
    69
  [255]