Re: unable to check in code to svn when files contain spaces or characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]





On Mon, Jan 24, 2011 at 7:12 PM, Les Mikesell <lesmikesell@xxxxxxxxx> wrote:
On 1/24/11 5:57 AM, Agnello George wrote:
> i got a file like this and i need add it into my svn
>
> admin/upload_data/FINAL  leg  list  19_01_2010 to  agar  (Merged data in one).xls
>
> i as able to add other files with space using the following command :
>
>   svn st |grep ? |cut -c8- |sed 's/ /\\ /g' |xargs svn add
>
> however there are some special characters like ( ) +#@  that svn cannot
> understand as the full path of  the file .
>
> can some one help me in this in perl or in shell .

What you need to know is too long to describe here, but first you need to find a
list of shell metacharacters and how to quote them on the command line. Short
version is that a \ quotes the next character single quotes quote everything
except another single quote literally, double quotes cover most things but allow
$variable expansion.

Then you need to look at what subversion itself requires after you get the
literal value past the shell parser.  I thought it was just that @ was
interpreted as file@revision peg revision unless you append another @ to the end
but there could be more restrictions.   All of that is simple enough to work
around - but probably not worth it compared to using sensible names.  However
the thing that is going to kill you is that files that differ only in case of
one or more letters are different files on linux - and in a linux svn repository
- but not on windows (where such things are most likely being created).  Enforce
some rules before that happens.

--
  Les Mikesell
   lesmikesell@xxxxxxxxx



I found the solution ( i think )
i did

 svn add  html/Set min account.html
svn: warning: 'html/Set' not found
svn: warning: 'min' not found
svn: warning: 'account.html' not found


then i did
svn add  "html/Set min account.html"
A         html/Set min account.html


so here is my final answer

instead of doing

for i in $(svn st | grep "?" | awk '{print $2}'); do svn add $i;done

i can do

for i in $(svn st | grep "?" | awk '{print $2}'); do svn add "$i" ;done

This is working for me ... i wonder if i am going to stumble somewhere ...humm!

--
Regards
Agnello D'souza


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux