comparison tests/test-remotefilelog-gcrepack.t @ 42353:f22131315791

tests: make the grep pattern in remotefilelog-gcrepack portable (issue6122) test-remotefilelog-gcrepack was using "\" to escape "|" in the grep pattern. The most of implementations ignore "\" when it is followed by "|", so the regex works. However, OpenBSD doesn't ignore "\" and considers "|" part of the text instead of create two branches. Neither of both behaviors violate POSIX. This change removes the unnecessary escape character and changes grep to egrep, so the extended regular expression works on every unix. This is part of the bug 6122. Tested on OpenBSD, GNU, FreeBSD, NetBSD, Solaris 11 and BusyBox. Credits to Todd C. Miller, Paul de Weerd and Ingo Schwarze for helping me with it.
author Juan Francisco Cantero Hurtado <iam@juanfra.info>
date Tue, 21 May 2019 19:23:14 +0200
parents 0800d9e6e216
children fac25de8cbec
comparison
equal deleted inserted replaced
42352:1bc7d4cb4182 42353:f22131315791
41 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) 41 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
42 $ hg repack 42 $ hg repack
43 $ sleep 0.5 43 $ sleep 0.5
44 $ hg debugwaitonrepack >/dev/null 2>%1 44 $ hg debugwaitonrepack >/dev/null 2>%1
45 45
46 $ find $CACHEDIR | sort | grep ".datapack\|.histpack" 46 $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
47 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack 47 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
48 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack 48 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack
49 49
50 # Ensure that all file versions were prefetched 50 # Ensure that all file versions were prefetched
51 51
74 74
75 $ hg repack 75 $ hg repack
76 $ sleep 0.5 76 $ sleep 0.5
77 $ hg debugwaitonrepack >/dev/null 2>%1 77 $ hg debugwaitonrepack >/dev/null 2>%1
78 78
79 $ find $CACHEDIR | sort | grep ".datapack\|.histpack" 79 $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
80 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack 80 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
81 $TESTTMP/hgcache/master/packs/a4e1d094ec2aee8a08a4d6d95a13c634cc7d7394.datapack 81 $TESTTMP/hgcache/master/packs/a4e1d094ec2aee8a08a4d6d95a13c634cc7d7394.datapack
82 82
83 # Ensure that file 'x' was garbage collected. It should be GCed because it is not in the keepset 83 # Ensure that file 'x' was garbage collected. It should be GCed because it is not in the keepset
84 # and is old (commit date is 0.0 in tests). Ensure that file 'y' is present as it is in the keepset. 84 # and is old (commit date is 0.0 in tests). Ensure that file 'y' is present as it is in the keepset.
102 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) 102 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
103 $ hg repack 103 $ hg repack
104 $ sleep 0.5 104 $ sleep 0.5
105 $ hg debugwaitonrepack >/dev/null 2>%1 105 $ hg debugwaitonrepack >/dev/null 2>%1
106 106
107 $ find $CACHEDIR | sort | grep ".datapack\|.histpack" 107 $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
108 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack 108 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
109 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack 109 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack
110 110
111 # Ensure that all file versions were prefetched 111 # Ensure that all file versions were prefetched
112 112
136 136
137 $ hg repack 137 $ hg repack
138 $ sleep 0.5 138 $ sleep 0.5
139 $ hg debugwaitonrepack >/dev/null 2>%1 139 $ hg debugwaitonrepack >/dev/null 2>%1
140 140
141 $ find $CACHEDIR | sort | grep ".datapack\|.histpack" 141 $ find $CACHEDIR | sort | egrep ".datapack|.histpack"
142 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack 142 $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack
143 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack 143 $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack
144 144
145 # Ensure that all file versions were prefetched 145 # Ensure that all file versions were prefetched
146 146