Mercurial > hg
annotate tests/test-parse-date @ 11769:ca6cebd8734e stable
dirstate: ignore symlinks when fs cannot handle them (issue1888)
When the filesystem cannot handle the executable bit, we currently
ignore it completely when looking for modified files. Similarly, it is
impossible to set or clear the bit when the filesystem ignores it.
This patch makes Mercurial treat symbolic links the same way.
Symlinks are a little different since they manifest themselves as
small files containing a filename (the symlink target). On Windows,
these files show up as regular files, and on Linux and Mac they show
up as real symlinks.
Issue1888 presents a case where the symlink files are better ignored
from the Windows side. A Linux client creates symlinks in a working
copy which is shared over a network between Linux and Windows clients.
The Samba server is helpful and defererences the symlink when the
Windows client looks at it. This means that Mercurial on the Windows
side sees file content instead of a file name in the symlink, and
hence flags the link as modified. Ignoring the change would be much
more helpful, similarly to how Mercurial does not report any changes
when executable bits are ignored in a checkout on Windows.
An initial checkout of a symbolic link on a file system that cannot
handle symbolic links will still result in a regular file containing
the target file name as its content. Sharing such a checkout with a
Linux client will not turn the file into a symlink automatically, but
'hg revert' can fix that. After the revert, the Windows client will
see the correct file content (provided by the Samba server when it
follows the link on the Linux side) and otherwise ignore the change.
Running 'hg perfstatus' 10 times gives these results:
Before: After:
min: 0.544703 min: 0.546549
med: 0.547592 med: 0.548881
avg: 0.549146 avg: 0.548549
max: 0.564112 max: 0.551504
The median time is increased about 0.24%.
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Mon, 09 Aug 2010 15:31:56 +0200 |
parents | 08a0f04b56bd |
children |
rev | line source |
---|---|
2522
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
1 #!/bin/sh |
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
2 |
3255
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
3 # This runs with TZ="GMT" |
2522
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
4 hg init |
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
5 echo "test-parse-date" > a |
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
6 hg add a |
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
7 hg ci -d "2006-02-01 13:00:30" -m "rev 0" |
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
8 echo "hi!" >> a |
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
9 hg ci -d "2006-02-01 13:00:30 -0500" -m "rev 1" |
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
10 hg tag -d "2006-04-15 13:30" "Hi" |
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
11 hg backout --merge -d "2006-04-15 13:30 +0200" -m "rev 3" 1 |
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
12 hg ci -d "1150000000 14400" -m "rev 4 (merge)" |
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
13 echo "fail" >> a |
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
14 hg ci -d "should fail" -m "fail" |
2524
c1974f65d781
add more testcases for date parsing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
2522
diff
changeset
|
15 hg ci -d "100000000000000000 1400" -m "fail" |
c1974f65d781
add more testcases for date parsing
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
2522
diff
changeset
|
16 hg ci -d "100000 1400000" -m "fail" |
3255
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
17 |
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
18 # Check with local timezone other than GMT and with DST |
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
19 TZ="PST+8PDT" |
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
20 export TZ |
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
21 # PST=UTC-8 / PDT=UTC-7 |
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
22 hg debugrebuildstate |
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
23 echo "a" > a |
3256
e5c9a084ffe3
util.strdate: assume local time when no timezone specified
Jose M. Prieto <jmprieto@gmx.net>
parents:
3255
diff
changeset
|
24 hg ci -d "2006-07-15 13:30" -m "summer@UTC-7" |
3255
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
25 hg debugrebuildstate |
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
26 echo "b" > a |
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
27 hg ci -d "2006-07-15 13:30 +0500" -m "summer@UTC+5" |
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
28 hg debugrebuildstate |
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
29 echo "c" > a |
3256
e5c9a084ffe3
util.strdate: assume local time when no timezone specified
Jose M. Prieto <jmprieto@gmx.net>
parents:
3255
diff
changeset
|
30 hg ci -d "2006-01-15 13:30" -m "winter@UTC-8" |
3255
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
31 hg debugrebuildstate |
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
32 echo "d" > a |
e96d2956eb4a
util.strdate: compute timestamp using UTC, not local timezone
Jose M. Prieto <jmprieto@gmx.net>
parents:
2524
diff
changeset
|
33 hg ci -d "2006-01-15 13:30 +0500" -m "winter@UTC+5" |
2522
85f796baab10
Allow the use of human readable dates (issue 251)
Jose M. Prieto <jmprieto@gmx.net>
parents:
diff
changeset
|
34 hg log --template '{date|date}\n' |
6236
ad6b123de1c7
Add tests for the fixes to issue1014 (fractional timezones)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3256
diff
changeset
|
35 |
ad6b123de1c7
Add tests for the fixes to issue1014 (fractional timezones)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3256
diff
changeset
|
36 # Test issue1014 (fractional timezones) |
ad6b123de1c7
Add tests for the fixes to issue1014 (fractional timezones)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3256
diff
changeset
|
37 hg debugdate "1000000000 -16200" # 0430 |
ad6b123de1c7
Add tests for the fixes to issue1014 (fractional timezones)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3256
diff
changeset
|
38 hg debugdate "1000000000 -15300" # 0415 |
ad6b123de1c7
Add tests for the fixes to issue1014 (fractional timezones)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3256
diff
changeset
|
39 hg debugdate "1000000000 -14400" # 0400 |
ad6b123de1c7
Add tests for the fixes to issue1014 (fractional timezones)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3256
diff
changeset
|
40 hg debugdate "1000000000 0" # GMT |
ad6b123de1c7
Add tests for the fixes to issue1014 (fractional timezones)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3256
diff
changeset
|
41 hg debugdate "1000000000 14400" # -0400 |
ad6b123de1c7
Add tests for the fixes to issue1014 (fractional timezones)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3256
diff
changeset
|
42 hg debugdate "1000000000 15300" # -0415 |
ad6b123de1c7
Add tests for the fixes to issue1014 (fractional timezones)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3256
diff
changeset
|
43 hg debugdate "1000000000 16200" # -0430 |
ad6b123de1c7
Add tests for the fixes to issue1014 (fractional timezones)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3256
diff
changeset
|
44 hg debugdate "Sat Sep 08 21:16:40 2001 +0430" |
ad6b123de1c7
Add tests for the fixes to issue1014 (fractional timezones)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3256
diff
changeset
|
45 hg debugdate "Sat Sep 08 21:16:40 2001 -0430" |
7953
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
46 |
9384
d91078a2652f
test-parse-date: test 12-hours time formats (issue1804)
Patrick Mezard <pmezard@gmail.com>
parents:
7953
diff
changeset
|
47 # Test 12-hours times |
d91078a2652f
test-parse-date: test 12-hours time formats (issue1804)
Patrick Mezard <pmezard@gmail.com>
parents:
7953
diff
changeset
|
48 hg debugdate "2006-02-01 1:00:30PM +0000" |
d91078a2652f
test-parse-date: test 12-hours time formats (issue1804)
Patrick Mezard <pmezard@gmail.com>
parents:
7953
diff
changeset
|
49 hg debugdate "1:00:30PM" > /dev/null || echo 'failed' |
d91078a2652f
test-parse-date: test 12-hours time formats (issue1804)
Patrick Mezard <pmezard@gmail.com>
parents:
7953
diff
changeset
|
50 |
7953
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
51 #Test date formats with '>' or '<' accompanied by space characters |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
52 hg log -d '>' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
53 hg log -d '<' hg log -d '>' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
54 |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
55 hg log -d ' >' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
56 hg log -d ' <' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
57 |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
58 hg log -d '> ' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
59 hg log -d '< ' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
60 |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
61 hg log -d ' > ' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
62 hg log -d ' < ' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
63 |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
64 |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
65 hg log -d '>02/01' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
66 hg log -d '<02/01' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
67 |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
68 hg log -d ' >02/01' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
69 hg log -d ' <02/01' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
70 |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
71 hg log -d '> 02/01' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
72 hg log -d '< 02/01' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
73 |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
74 hg log -d ' > 02/01' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
75 hg log -d ' < 02/01' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
76 |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
77 hg log -d '>02/01 ' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
78 hg log -d '<02/01 ' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
79 |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
80 hg log -d ' >02/01 ' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
81 hg log -d ' <02/01 ' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
82 |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
83 hg log -d '> 02/01 ' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
84 hg log -d '< 02/01 ' --template '{date|date}\n' |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
85 |
8c6f823efcc9
Correct a bug on date formats with '>' or '<' accompanied by space characters.
Justin Peng <justin.peng.sw@gmail.com>
parents:
6236
diff
changeset
|
86 hg log -d ' > 02/01 ' --template '{date|date}\n' |
10282
08a0f04b56bd
many, many trivial check-code fixups
Matt Mackall <mpm@selenic.com>
parents:
9384
diff
changeset
|
87 hg log -d ' < 02/01 ' --template '{date|date}\n' |