check-code: fix check for trailing whitespace on continued lines too
authorMads Kiilerich <mads@kiilerich.com>
Wed, 08 Aug 2012 18:10:37 +0200
changeset 17347 2da47de36b6f
parent 17346 2944a6d35158
child 17352 c6f88e7f95b7
check-code: fix check for trailing whitespace on continued lines too The tests in test-annotate.t and test-import-git.t that relied on trailing space in a file created by a here string is now masked by a literal 'EOL' string that is removed.
contrib/check-code.py
tests/test-annotate.t
tests/test-convert-svn-branches.t
tests/test-convert-svn-encoding.t
tests/test-convert-svn-move.t
tests/test-convert-svn-sink.t
tests/test-convert-svn-source.t
tests/test-convert-svn-startrev.t
tests/test-convert-svn-tags.t
tests/test-glog.t
tests/test-import-git.t
tests/test-mq-header-date.t
tests/test-mq-qimport.t
tests/test-update-branches.t
--- a/contrib/check-code.py	Wed Aug 08 18:10:30 2012 +0200
+++ b/contrib/check-code.py	Wed Aug 08 18:10:37 2012 +0200
@@ -91,7 +91,7 @@
 uprefix = r"^  \$ "
 utestpats = [
   [
-    (r'^(\S.*||  \$ .*)[ \t]\n', "trailing whitespace on non-output"),
+    (r'^(\S.*||  [$>] .*)[ \t]\n', "trailing whitespace on non-output"),
     (uprefix + r'.*\|\s*sed[^|>\n]*\n',
      "use regex test output patterns instead of sed"),
     (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"),
--- a/tests/test-annotate.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-annotate.t	Wed Aug 08 18:10:37 2012 +0200
@@ -279,10 +279,10 @@
   > EOF
   $ hg ci -Am "adda"
   adding a
-  $ cat > a <<EOF
+  $ sed 's/EOL$//g' > a <<EOF
   > a  a
   > 
-  >  
+  >  EOL
   > b  b
   > EOF
   $ hg ci -m "changea"
--- a/tests/test-convert-svn-branches.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-convert-svn-branches.t	Wed Aug 08 18:10:37 2012 +0200
@@ -3,7 +3,7 @@
 
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
-  > convert = 
+  > convert =
   > graphlog =
   > EOF
 
@@ -14,7 +14,7 @@
 
   $ cat > branchmap <<EOF
   > old3 newbranch
-  >     
+  > 
   > 
   > EOF
   $ hg convert --branchmap=branchmap --datesort -r 10 svn-repo A-hg
--- a/tests/test-convert-svn-encoding.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-convert-svn-encoding.t	Wed Aug 08 18:10:37 2012 +0200
@@ -3,7 +3,7 @@
 
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
-  > convert = 
+  > convert =
   > graphlog =
   > EOF
 
--- a/tests/test-convert-svn-move.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-convert-svn-move.t	Wed Aug 08 18:10:37 2012 +0200
@@ -3,7 +3,7 @@
 
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
-  > convert = 
+  > convert =
   > graphlog =
   > EOF
 
@@ -155,7 +155,7 @@
 
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
-  > progress = 
+  > progress =
   > [progress]
   > assume-tty = 1
   > delay = 0
--- a/tests/test-convert-svn-sink.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-convert-svn-sink.t	Wed Aug 08 18:10:37 2012 +0200
@@ -16,7 +16,7 @@
 
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
-  > convert = 
+  > convert =
   > graphlog =
   > EOF
 
--- a/tests/test-convert-svn-source.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-convert-svn-source.t	Wed Aug 08 18:10:37 2012 +0200
@@ -3,7 +3,7 @@
 
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
-  > convert = 
+  > convert =
   > graphlog =
   > [convert]
   > svn.trunk = mytrunk
--- a/tests/test-convert-svn-startrev.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-convert-svn-startrev.t	Wed Aug 08 18:10:37 2012 +0200
@@ -3,7 +3,7 @@
 
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
-  > convert = 
+  > convert =
   > graphlog =
   > EOF
   $ convert()
--- a/tests/test-convert-svn-tags.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-convert-svn-tags.t	Wed Aug 08 18:10:37 2012 +0200
@@ -3,7 +3,7 @@
 
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
-  > convert = 
+  > convert =
   > graphlog =
   > EOF
 
--- a/tests/test-glog.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-glog.t	Wed Aug 08 18:10:37 2012 +0200
@@ -83,7 +83,7 @@
 
   $ cat > printrevset.py <<EOF
   > from mercurial import extensions, revset, commands, cmdutil
-  >  
+  > 
   > def uisetup(ui):
   >     def printrevset(orig, ui, repo, *pats, **opts):
   >         if opts.get('print_revset'):
--- a/tests/test-import-git.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-import-git.t	Wed Aug 08 18:10:37 2012 +0200
@@ -322,12 +322,12 @@
 
 Filenames with spaces:
 
-  $ hg import -d "1000000 0" -m spaces - <<EOF
+  $ sed 's,EOL$,,g' <<EOF | hg import -d "1000000 0" -m spaces -
   > diff --git a/foo bar b/foo bar
   > new file mode 100644
   > index 0000000..257cc56
   > --- /dev/null
-  > +++ b/foo bar	
+  > +++ b/foo bar	EOL
   > @@ -0,0 +1 @@
   > +foo
   > EOF
--- a/tests/test-mq-header-date.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-mq-header-date.t	Wed Aug 08 18:10:37 2012 +0200
@@ -128,7 +128,7 @@
   >     catlogd 6
   > 
   >     drop 6
-  >     
+  > 
   > 
   >     echo ==== qnew -u
   >     hg qnew -u jane 6.patch
--- a/tests/test-mq-qimport.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-mq-qimport.t	Wed Aug 08 18:10:37 2012 +0200
@@ -169,7 +169,7 @@
 
   $ cat > appendfoo.diff <<EOF
   > append foo
-  >  
+  > 
   > diff -r 07f494440405 -r 261500830e46 baz
   > --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   > +++ b/baz	Thu Jan 01 00:00:00 1970 +0000
@@ -179,7 +179,7 @@
 
   $ cat > appendbar.diff <<EOF
   > append bar
-  >  
+  > 
   > diff -r 07f494440405 -r 261500830e46 baz
   > --- a/baz	Thu Jan 01 00:00:00 1970 +0000
   > +++ b/baz	Thu Jan 01 00:00:00 1970 +0000
--- a/tests/test-update-branches.t	Wed Aug 08 18:10:30 2012 +0200
+++ b/tests/test-update-branches.t	Wed Aug 08 18:10:37 2012 +0200
@@ -61,7 +61,7 @@
   >     hg up $opt $targetrev
   >     hg parent --template 'parent={rev}\n'
   >     hg stat -S
-  > }    
+  > }
 
   $ norevtest () {
   >     msg=$1
@@ -74,7 +74,7 @@
   >     hg up $opt
   >     hg parent --template 'parent={rev}\n'
   >     hg stat -S
-  > }    
+  > }
 
 Test cases are documented in a table in the update function of merge.py.
 Cases are run as shown in that table, row by row.