You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Justin Johnson <ju...@honesthacker.com> on 2010/06/25 14:09:39 UTC

auto-props on import use local temp file name instead of remote destination file name

Hi,

I am attempting to import a file and set svn:eol-style in one command using
the --auto-props and --config-option options to svn import.  When I do the
import I explicitly specify the file name in the import URL.  The reason I
do this is because I want to import from a randomly generated temp file name
but I want the file to be named config.ini in the repository.  After some
 testing I have determined that svn uses the temp file name when evaluating
if an auto-prop should be applied instead of using the remote file name
specified on the import URL.  The test script below reproduces the problem.

It seems to me that when a path to a file is specified as the import URL,
svn should use that file name in evaluating the auto-props, but perhaps
there is some other reason it works this way.  If anyone can clarify or
confirm that this is a bug I would appreciate it.

Thanks.
Justin



# Create repo
svnadmin create testrepo
repourl=file://`pwd`/testrepo

# Import config.ini from tmp file named config.ini
touch config.ini
svn import --auto-props -m "add config file" --config-option
"config:auto-props:
config.ini=svn:eol-style=LF" config.ini $repourl/config.ini

# See if svn:eol-style was set
echo "1. config.ini properties: "
svn pl -v $repourl/config.ini

# Try again with a temp file named something other than config.ini
rm -rf testrepo
svnadmin create testrepo
touch tmpconfig.ini
svn import --auto-props -m "add config file" --config-option
"config:auto-props:
config.ini=svn:eol-style=LF" tmpconfig.ini $repourl/config.ini

# See if svn:eol-style was set
echo "2. config.ini properties: "
svn pl -v $repourl/config.ini


$ ./test.sh
Adding         config.ini

Committed revision 1.
1. config.ini properties:
Properties on 'file:///svn/data/test/testrepo/config.ini':
  svn:eol-style
    LF
Adding         tmpconfig.ini

Committed revision 1.
2. config.ini properties:

Re: auto-props on import use local temp file name instead of remote destination file name

Posted by Justin Johnson <ju...@honesthacker.com>.
>
> Hi Justin,
>
> On Fri, Jun 25, 2010 at 09:09:39AM -0500, Justin Johnson wrote:
>
> > I am attempting to import a file and set svn:eol-style in one command
> using
> > the --auto-props and --config-option options to svn import.  When I do
> the
> > import I explicitly specify the file name in the import URL.  The reason
> I
> > do this is because I want to import from a randomly generated temp file
> name
> > but I want the file to be named config.ini in the repository.  After some
> >  testing I have determined that svn uses the temp file name when
> evaluating
> > if an auto-prop should be applied instead of using the remote file name
> > specified on the import URL.  The test script below reproduces the
> problem.
> >
> > It seems to me that when a path to a file is specified as the import URL,
> > svn should use that file name in evaluating the auto-props, but perhaps
> > there is some other reason it works this way.  If anyone can clarify or
> > confirm that this is a bug I would appreciate it.
>
> Why don't you just rename the file to config.ini before import?
>
> Tino.
>
>
That is what I'm doing to work around the problem.  This doesn't seem
intuitive though and I'm wondering if perhaps the Subversion developers
didn't think of this case when implementing this feature.  It took a while
for me to determine what the problem was and I would like it if no one else
had to waste that time.

Can any Subversion developer weigh in on this?

Thanks.
Justin

Re: auto-props on import use local temp file name instead of remote destination file name

Posted by Tino Schwarze <su...@tisc.de>.
Hi Justin,

On Fri, Jun 25, 2010 at 09:09:39AM -0500, Justin Johnson wrote:

> I am attempting to import a file and set svn:eol-style in one command using
> the --auto-props and --config-option options to svn import.  When I do the
> import I explicitly specify the file name in the import URL.  The reason I
> do this is because I want to import from a randomly generated temp file name
> but I want the file to be named config.ini in the repository.  After some
>  testing I have determined that svn uses the temp file name when evaluating
> if an auto-prop should be applied instead of using the remote file name
> specified on the import URL.  The test script below reproduces the problem.
> 
> It seems to me that when a path to a file is specified as the import URL,
> svn should use that file name in evaluating the auto-props, but perhaps
> there is some other reason it works this way.  If anyone can clarify or
> confirm that this is a bug I would appreciate it.

Why don't you just rename the file to config.ini before import?

Tino.

-- 
"What we nourish flourishes." - "Was wir nähren erblüht."

www.tisc.de

Re: auto-props on import use local temp file name instead of remote destination file name

Posted by Tino Schwarze <su...@tisc.de>.
Hi Justin,

On Fri, Jun 25, 2010 at 09:09:39AM -0500, Justin Johnson wrote:

> I am attempting to import a file and set svn:eol-style in one command using
> the --auto-props and --config-option options to svn import.  When I do the
> import I explicitly specify the file name in the import URL.  The reason I
> do this is because I want to import from a randomly generated temp file name
> but I want the file to be named config.ini in the repository.  After some
>  testing I have determined that svn uses the temp file name when evaluating
> if an auto-prop should be applied instead of using the remote file name
> specified on the import URL.  The test script below reproduces the problem.
> 
> It seems to me that when a path to a file is specified as the import URL,
> svn should use that file name in evaluating the auto-props, but perhaps
> there is some other reason it works this way.  If anyone can clarify or
> confirm that this is a bug I would appreciate it.

Why don't you just rename the file to config.ini before import?

Tino.

-- 
"What we nourish flourishes." - "Was wir nähren erblüht."

www.tisc.de

Re: auto-props on import use local temp file name instead of remote destination file name

Posted by Justin Johnson <ju...@honesthacker.com>.
>
> Hi,
>
> I am attempting to import a file and set svn:eol-style in one command using
> the --auto-props and --config-option options to svn import.  When I do the
> import I explicitly specify the file name in the import URL.  The reason I
> do this is because I want to import from a randomly generated temp file name
> but I want the file to be named config.ini in the repository.  After some
>  testing I have determined that svn uses the temp file name when evaluating
> if an auto-prop should be applied instead of using the remote file name
> specified on the import URL.  The test script below reproduces the problem.
>
> It seems to me that when a path to a file is specified as the import URL,
> svn should use that file name in evaluating the auto-props, but perhaps
> there is some other reason it works this way.  If anyone can clarify or
> confirm that this is a bug I would appreciate it.
>
> Thanks.
> Justin
>
>
>
> # Create repo
> svnadmin create testrepo
> repourl=file://`pwd`/testrepo
>
> # Import config.ini from tmp file named config.ini
> touch config.ini
> svn import --auto-props -m "add config file" --config-option
> "config:auto-props:
> config.ini=svn:eol-style=LF" config.ini $repourl/config.ini
>
> # See if svn:eol-style was set
> echo "1. config.ini properties: "
> svn pl -v $repourl/config.ini
>
> # Try again with a temp file named something other than config.ini
> rm -rf testrepo
> svnadmin create testrepo
> touch tmpconfig.ini
> svn import --auto-props -m "add config file" --config-option
> "config:auto-props:
> config.ini=svn:eol-style=LF" tmpconfig.ini $repourl/config.ini
>
> # See if svn:eol-style was set
> echo "2. config.ini properties: "
> svn pl -v $repourl/config.ini
>
>
> $ ./test.sh
> Adding         config.ini
>
> Committed revision 1.
> 1. config.ini properties:
> Properties on 'file:///svn/data/test/testrepo/config.ini':
>   svn:eol-style
>     LF
> Adding         tmpconfig.ini
>
> Committed revision 1.
> 2. config.ini properties:
>
>
I forgot to mention, I'm running svn 1.6.12 on Solaris 10.