comparison tests/test-fix.t @ 41126:d8f5c615e811

tests: use more portable flags in test-fix.t `head --lines N` is known to not exist on OSX. Differential Revision: https://phab.mercurial-scm.org/D5517
author Danny Hooper <hooper@google.com>
date Mon, 07 Jan 2019 15:25:41 -0800
parents e8e2a7656e83
children 7f6b375a8903
comparison
equal deleted inserted replaced
41125:126101284e04 41126:d8f5c615e811
171 execution order of tools with equal priority is unspecified. For example, you 171 execution order of tools with equal priority is unspecified. For example, you
172 could use the 'sort' and 'head' utilities to keep only the 10 smallest numbers 172 could use the 'sort' and 'head' utilities to keep only the 10 smallest numbers
173 in a text file by ensuring that 'sort' runs before 'head': 173 in a text file by ensuring that 'sort' runs before 'head':
174 174
175 [fix] 175 [fix]
176 sort:command = sort --numeric-sort 176 sort:command = sort -n
177 head:command = head --lines=10 177 head:command = head -n 10
178 sort:pattern = numbers.txt 178 sort:pattern = numbers.txt
179 head:pattern = numbers.txt 179 head:pattern = numbers.txt
180 sort:priority = 2 180 sort:priority = 2
181 head:priority = 1 181 head:priority = 1
182 182
1157 $ hg init priorityexample 1157 $ hg init priorityexample
1158 $ cd priorityexample 1158 $ cd priorityexample
1159 1159
1160 $ cat >> .hg/hgrc <<EOF 1160 $ cat >> .hg/hgrc <<EOF
1161 > [fix] 1161 > [fix]
1162 > head:command = head --lines=5 1162 > head:command = head -n 5
1163 > head:pattern = numbers.txt 1163 > head:pattern = numbers.txt
1164 > head:priority = 1 1164 > head:priority = 1
1165 > sort:command = sort --numeric-sort 1165 > sort:command = sort -n
1166 > sort:pattern = numbers.txt 1166 > sort:pattern = numbers.txt
1167 > sort:priority = 2 1167 > sort:priority = 2
1168 > EOF 1168 > EOF
1169 1169
1170 $ printf "8\n2\n3\n6\n7\n4\n9\n5\n1\n0\n" > numbers.txt 1170 $ printf "8\n2\n3\n6\n7\n4\n9\n5\n1\n0\n" > numbers.txt