Set property for import

View: New views
3 Messages — Rating Filter:   Alert me  

Set property for import

by stellal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
  I just want to import a local file, "/usr/tmp/abc.xml" to svn:/inhouse

                BasicAuthenticationManager authMgr = new BasicAuthenticationManager(userName, passwd);
                DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(false);
                options.setAutoProperty("*.xml", "svn:keywords=Rev Date");
                SVNCommitClient commitClient = new SVNCommitClient(authMgr, options));
                File inFile = new File("/usr/tmp/abc.xml");
                commitClient.doImport(inFile, svnURL, commitComment, null, false, true, SVNDepth.IMMEDIATES);

But it doesn't set the property.

The output is:
svn: 'pre-commit' hook failed with error output:
This change failed because the following file does not include the required value 'Rev' for the Subversion property 'svn:keywords':
branches/inhouse/abc.xml
Please use 'svn propset' to ensure that this file contains the required property listed above.

Please help!

Stella

Re: Set property for import

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Stella,

With your approach you also need to enable auto properties in
configuration (options file):

options.setUseAutoProperties(true);

You may also access options file as "readonly" - changes you make will
be still used an that very runtime session, but no written to disk.

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

stellal wrote:

> Hi,
>   I just want to import a local file, "/usr/tmp/abc.xml" to svn:/inhouse
>
> BasicAuthenticationManager authMgr = new
> BasicAuthenticationManager(userName, passwd);
> DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(false);
> options.setAutoProperty("*.xml", "svn:keywords=Rev Date");
> SVNCommitClient commitClient = new SVNCommitClient(authMgr, options));
>                 File inFile = new File("/usr/tmp/abc.xml");
> commitClient.doImport(inFile, svnURL, commitComment, null, false, true,
> SVNDepth.IMMEDIATES);
>
> But it doesn't set the property.
>
> The output is:
> svn: 'pre-commit' hook failed with error output:
> This change failed because the following file does not include the required
> value 'Rev' for the Subversion property 'svn:keywords':
> branches/inhouse/abc.xml
> Please use 'svn propset' to ensure that this file contains the required
> property listed above.
>
> Please help!
>
> Stella
>

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...


Re: Set property for import

by stellal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Alex,
   I enabled the auto properties in .subversion/config under my home directory, and import is fine now.
   It works on pc, where auto properties is: enable-auto-props = yes.
   Just needed to set that when I run it on Unix side.
   Thanks.
Stella

Alexander Kitaev-3 wrote:
Dear Stella,

With your approach you also need to enable auto properties in
configuration (options file):

options.setUseAutoProperties(true);

You may also access options file as "readonly" - changes you make will
be still used an that very runtime session, but no written to disk.

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

stellal wrote:
> Hi,
>   I just want to import a local file, "/usr/tmp/abc.xml" to svn:/inhouse
>
> BasicAuthenticationManager authMgr = new
> BasicAuthenticationManager(userName, passwd);
> DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(false);
> options.setAutoProperty("*.xml", "svn:keywords=Rev Date");
> SVNCommitClient commitClient = new SVNCommitClient(authMgr, options));
>                 File inFile = new File("/usr/tmp/abc.xml");
> commitClient.doImport(inFile, svnURL, commitComment, null, false, true,
> SVNDepth.IMMEDIATES);
>
> But it doesn't set the property.
>
> The output is:
> svn: 'pre-commit' hook failed with error output:
> This change failed because the following file does not include the required
> value 'Rev' for the Subversion property 'svn:keywords':
> branches/inhouse/abc.xml
> Please use 'svn propset' to ensure that this file contains the required
> property listed above.
>
> Please help!
>
> Stella
>

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@svnkit.com
For additional commands, e-mail: svnkit-users-help@svnkit.com