[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

BUG: one `auto-prop' line masks another

From: Eric Hanchrow <offby1_at_blarg.net>
Date: 2004-08-29 02:09:40 CEST

Just run the following script on
http://svn.collab.net/repos/svn/branches/1.1.x on Linux or Unix, not
Windows; note that one of the files in the working copy contains
carriage-returns. It shouldn't.

  #!/bin/bash

  # Run this script on http://svn.collab.net/repos/svn/branches/1.1.x
  # Linux or Unix, not Windows.

  # This demonstrates a bug in the handling of auto-props.

  # We create a couple of files (whose names end with `.pl') , one of
  # which is "windows style": its lines ends with
  # carriage-return/line-feed. Then we create a new repository, and
  # edit our client config file to enable automatic setting of
  # svn:eol-style to `native' for .pl files.

  # We add those files to the repository, and examine their contents
  # after adding. If everything is working as it should, neither file
  # should contain any carriage returns. However, as you'll see, the
  # second file still contains them.

  # What's tricky is that, if we comment out the line in the client
  # config file that refers to .PL (note the upper-case letters),
  # everything works as we'd expect. Everything also works if we
  # interchange that line with the one after it (so that `.pl' comes
  # before `.PL').

  r=/tmp/repos
  w=/tmp/wc
  c=$HOME/.subversion/config
  b=$c.bak

  if [ -f $b ]; then
      echo will not clobber $b ;
      exit
  fi

  mv $c $b

  echo [miscellany] > $c
  echo enable-auto-props = yes >> $c
  echo [auto-props] >> $c

  # Comment out this line, or exchange it with the one immediately
  # following it, and everything works as expected.
  echo '*.PL = svn:eol-style=native;svn:executable' >> $c
  echo '*.pl = svn:eol-style=native;svn:executable' >> $c

  rm -rf $r $w
  svnadmin create $r
  svn co file://$r $w
  cd $w

  echo -e This line hath no carriage return > one.pl

  echo -e I gots one.\\r > two.pl
  echo -e I gots one, too.\\r >> two.pl

  dump ()
  {
      for i in *.pl
        do
        od -c $i
        echo ----
      done
  }

  svn add one.pl two.pl
  svn -m "" ci

  echo If you see \\r anywhere in the below, that\'s a bug.

  dump

-- 
That is the true genius of America ... that our votes will be
counted, at least most of the time.
        -- Barack Obama, 2004 Democratic National Convention
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Aug 29 02:09:57 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.