comparison tests/test-mq.t @ 12375:02990e22150b

tests: require regexes in unified tests to be marked with " (re)" Consider this test: $ hg glog --template '{rev}:{node|short} "{desc}"\n' @ 2:20c4f79fd7ac "3" | | o 1:38f24201dcab "2" |/ o 0:2a18120dc1c9 "1" Because each line beginning with "|" can be compiled as a regular expression (equivalent to ".*|"), they will match any output. Similarly: $ echo foo The blank output line can be compiled as a regular expression and will also match any output. With this patch, none of the above output lines will be matched as regular expressions. A line must end in " (re)" in order to be matched as one. Lines are still matched literally first, so the following will pass: $ echo 'foo (re)' foo (re)
author Brodie Rao <brodie@bitheap.org>
date Wed, 22 Sep 2010 16:06:00 -0500
parents 22f3353bcc36
children 97ffc68f71d3
comparison
equal deleted inserted replaced
12374:4e7dd28db0dd 12375:02990e22150b
133 syntax: glob 133 syntax: glob
134 status 134 status
135 guards 135 guards
136 $ cat .hg/patches/series 136 $ cat .hg/patches/series
137 $ hg qinit -c 137 $ hg qinit -c
138 abort: repository .* already exists! 138 abort: repository .* already exists! (re)
139 [255] 139 [255]
140 $ cd .. 140 $ cd ..
141 141
142 $ echo '% qinit; <stuff>; qinit -c' 142 $ echo '% qinit; <stuff>; qinit -c'
143 % qinit; <stuff>; qinit -c 143 % qinit; <stuff>; qinit -c
235 $ echo a >> a 235 $ echo a >> a
236 $ hg qrefresh 236 $ hg qrefresh
237 $ cat .hg/patches/test.patch 237 $ cat .hg/patches/test.patch
238 foo bar 238 foo bar
239 239
240 diff -r [a-f0-9]* a 240 diff -r [a-f0-9]* a (re)
241 --- a/a\t(?P<date>.*) 241 --- a/a\t(?P<date>.*) (re)
242 \+\+\+ b/a\t(?P<date2>.*) 242 \+\+\+ b/a\t(?P<date2>.*) (re)
243 @@ -1,1 +1,2 @@ 243 @@ -1,1 +1,2 @@
244 a 244 a
245 +a 245 +a
246 246
247 empty qrefresh 247 empty qrefresh
288 $ hg tags > /dev/null 288 $ hg tags > /dev/null
289 289
290 .hg/tags.cache (pre qpush): 290 .hg/tags.cache (pre qpush):
291 291
292 $ cat .hg/tags.cache 292 $ cat .hg/tags.cache
293 1 [\da-f]{40} 293 1 [\da-f]{40} (re)
294 294
295 $ hg qpush 295 $ hg qpush
296 applying test.patch 296 applying test.patch
297 now at: test.patch 297 now at: test.patch
298 $ hg tags > /dev/null 298 $ hg tags > /dev/null
299 299
300 .hg/tags.cache (post qpush): 300 .hg/tags.cache (post qpush):
301 301
302 $ cat .hg/tags.cache 302 $ cat .hg/tags.cache
303 2 [\da-f]{40} 303 2 [\da-f]{40} (re)
304 304
305 $ checkundo qpush 305 $ checkundo qpush
306 $ cd .. 306 $ cd ..
307 307
308 308
735 $ echo x>x 735 $ echo x>x
736 $ hg ci -Ama 736 $ hg ci -Ama
737 adding x 737 adding x
738 $ hg strip tip 738 $ hg strip tip
739 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 739 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
740 saved backup bundle to .* 740 saved backup bundle to .* (re)
741 $ hg unbundle .hg/strip-backup/* 741 $ hg unbundle .hg/strip-backup/*
742 adding changesets 742 adding changesets
743 adding manifests 743 adding manifests
744 adding file changes 744 adding file changes
745 added 1 changesets with 1 changes to 1 files 745 added 1 changesets with 1 changes to 1 files
758 758
759 --force strip with local changes 759 --force strip with local changes
760 760
761 $ hg strip -f tip 761 $ hg strip -f tip
762 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 762 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
763 saved backup bundle to .* 763 saved backup bundle to .* (re)
764 764
765 765
766 cd b; hg qrefresh 766 cd b; hg qrefresh
767 767
768 $ hg init refresh 768 $ hg init refresh
780 $ hg qrefresh 780 $ hg qrefresh
781 $ cat ../.hg/patches/foo 781 $ cat ../.hg/patches/foo
782 foo 782 foo
783 783
784 diff -r cb9a9f314b8b a 784 diff -r cb9a9f314b8b a
785 --- a/a\t(?P<date>.*) 785 --- a/a\t(?P<date>.*) (re)
786 \+\+\+ b/a\t(?P<date>.*) 786 \+\+\+ b/a\t(?P<date>.*) (re)
787 @@ -1,1 +1,2 @@ 787 @@ -1,1 +1,2 @@
788 a 788 a
789 +a 789 +a
790 diff -r cb9a9f314b8b b/f 790 diff -r cb9a9f314b8b b/f
791 --- /dev/null\t(?P<date>.*) 791 --- /dev/null\t(?P<date>.*) (re)
792 \+\+\+ b/b/f\t(?P<date>.*) 792 \+\+\+ b/b/f\t(?P<date>.*) (re)
793 @@ -0,0 +1,1 @@ 793 @@ -0,0 +1,1 @@
794 +f 794 +f
795 795
796 hg qrefresh . 796 hg qrefresh .
797 797
798 $ hg qrefresh . 798 $ hg qrefresh .
799 $ cat ../.hg/patches/foo 799 $ cat ../.hg/patches/foo
800 foo 800 foo
801 801
802 diff -r cb9a9f314b8b b/f 802 diff -r cb9a9f314b8b b/f
803 --- /dev/null\t(?P<date>.*) 803 --- /dev/null\t(?P<date>.*) (re)
804 \+\+\+ b/b/f\t(?P<date>.*) 804 \+\+\+ b/b/f\t(?P<date>.*) (re)
805 @@ -0,0 +1,1 @@ 805 @@ -0,0 +1,1 @@
806 +f 806 +f
807 $ hg status 807 $ hg status
808 M a 808 M a
809 809
1116 date: Thu Jan 01 00:00:00 1970 +0000 1116 date: Thu Jan 01 00:00:00 1970 +0000
1117 summary: add foo 1117 summary: add foo
1118 1118
1119 $ hg strip 1 1119 $ hg strip 1
1120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 1120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1121 saved backup bundle to .* 1121 saved backup bundle to .* (re)
1122 $ checkundo strip 1122 $ checkundo strip
1123 $ hg log 1123 $ hg log
1124 changeset: 1:20cbbe65cff7 1124 changeset: 1:20cbbe65cff7
1125 tag: tip 1125 tag: tip
1126 user: test 1126 user: test