tests/test-locate.out
author Renato Cunha <renatoc@gmail.com>
Tue, 03 Aug 2010 13:52:48 -0300
changeset 11748 37a70a784397
parent 4308 a5cde03cd019
permissions -rw-r--r--
py3kcompat: added a "compatibility layer" for py3k This patch adds some ugly constructs. The first of them is bytesformatter, a function that formats strings like when '%' is called. The main motivation for this function is py3k's strange behavior: >>> 'foo %s' % b'bar' "foo b'bar'" >>> b'foo %s' % b'bar' Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for %: 'bytes' and 'bytes' >>> b'foo %s' % 'bar' Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for %: 'bytes' and 'str' In other words, if we can't format bytes with bytes, and recall that all mercurial strings will be converted by a fixer, then things will break badly if we don't take a similar approach. The other addition with this patch is that the os.environ dictionary is monkeypatched to have bytes items. Hopefully this won't be needed in the future, as python 3.2 might get a os.environb dictionary that holds bytes items.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1622
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     1
adding a
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     2
adding b
4307
702f48570eb3 change relglob: patterns to be consistent with glob: patterns
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4235
diff changeset
     3
adding dir.h/foo
2487
041363739ca8 Test case for #294
Brendan Cully <brendan@kublai.com>
parents: 2480
diff changeset
     4
adding t.h
4235
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
     5
adding t/b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
     6
adding t/e.h
2480
519a1011db91 fix -I/-X when relative paths used or in subdir
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
     7
adding t/x
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
     8
hg locate a
1622
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     9
a
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    10
4196
1c69c73d85d9 locate: exit(1) if we didn't print any file
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4195
diff changeset
    11
locate succeeded
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    12
hg locate NONEXISTENT
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    13
4196
1c69c73d85d9 locate: exit(1) if we didn't print any file
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4195
diff changeset
    14
locate failed
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    15
hg locate 
1622
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    16
a
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    17
b
4307
702f48570eb3 change relglob: patterns to be consistent with glob: patterns
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4235
diff changeset
    18
dir.h/foo
2487
041363739ca8 Test case for #294
Brendan Cully <brendan@kublai.com>
parents: 2480
diff changeset
    19
t.h
4235
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    20
t/b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    21
t/e.h
2480
519a1011db91 fix -I/-X when relative paths used or in subdir
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
    22
t/x
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    23
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    24
hg locate a
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    25
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    26
hg locate NONEXISTENT
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    27
4308
a5cde03cd019 locate: don't print "file not found" messages.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4307
diff changeset
    28
hg locate relpath:NONEXISTENT
a5cde03cd019 locate: don't print "file not found" messages.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4307
diff changeset
    29
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    30
hg locate 
1622
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    31
b
4307
702f48570eb3 change relglob: patterns to be consistent with glob: patterns
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4235
diff changeset
    32
dir.h/foo
2487
041363739ca8 Test case for #294
Brendan Cully <brendan@kublai.com>
parents: 2480
diff changeset
    33
t.h
4235
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    34
t/b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    35
t/e.h
2480
519a1011db91 fix -I/-X when relative paths used or in subdir
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
    36
t/x
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    37
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    38
hg locate -r 0 a
1622
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    39
a
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    40
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    41
hg locate -r 0 NONEXISTENT
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    42
4308
a5cde03cd019 locate: don't print "file not found" messages.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4307
diff changeset
    43
hg locate -r 0 relpath:NONEXISTENT
a5cde03cd019 locate: don't print "file not found" messages.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4307
diff changeset
    44
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    45
hg locate -r 0
1622
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    46
a
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    47
b
4307
702f48570eb3 change relglob: patterns to be consistent with glob: patterns
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4235
diff changeset
    48
dir.h/foo
2487
041363739ca8 Test case for #294
Brendan Cully <brendan@kublai.com>
parents: 2480
diff changeset
    49
t.h
4235
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    50
t/b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    51
t/e.h
4194
8e947b0e53cc localrepo.walk: if we're walking a specific revision, sort the files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2487
diff changeset
    52
t/x
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    53
2480
519a1011db91 fix -I/-X when relative paths used or in subdir
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
    54
% -I/-X with relative path should work
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    55
hg locate 
2480
519a1011db91 fix -I/-X when relative paths used or in subdir
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
    56
b
4307
702f48570eb3 change relglob: patterns to be consistent with glob: patterns
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4235
diff changeset
    57
dir.h/foo
2487
041363739ca8 Test case for #294
Brendan Cully <brendan@kublai.com>
parents: 2480
diff changeset
    58
t.h
4235
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    59
t/b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    60
t/e.h
2480
519a1011db91 fix -I/-X when relative paths used or in subdir
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
    61
t/x
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    62
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    63
hg locate -I ../t
4235
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    64
t/b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    65
t/e.h
2480
519a1011db91 fix -I/-X when relative paths used or in subdir
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
    66
t/x
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    67
4307
702f48570eb3 change relglob: patterns to be consistent with glob: patterns
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4235
diff changeset
    68
hg locate t/**
4235
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    69
t/b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    70
t/e.h
2487
041363739ca8 Test case for #294
Brendan Cully <brendan@kublai.com>
parents: 2480
diff changeset
    71
t/x
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4196
diff changeset
    72
4235
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    73
hg locate b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    74
../b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    75
../t/b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    76
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    77
hg locate *.h
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    78
../t.h
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    79
../t/e.h
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    80
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    81
hg locate path:t/x
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    82
../t/x
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    83
4307
702f48570eb3 change relglob: patterns to be consistent with glob: patterns
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4235
diff changeset
    84
hg locate re:.*\.h$
4235
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    85
../t.h
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    86
../t/e.h
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    87
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    88
hg locate -r 0 b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    89
../b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    90
../t/b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    91
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    92
hg locate -r 0 *.h
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    93
../t.h
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    94
../t/e.h
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    95
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    96
hg locate -r 0 path:t/x
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    97
../t/x
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    98
4307
702f48570eb3 change relglob: patterns to be consistent with glob: patterns
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4235
diff changeset
    99
hg locate -r 0 re:.*\.h$
4235
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
   100
../t.h
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
   101
../t/e.h
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
   102