Ticket #170 (closed enhancement: fixed)

Opened 8 months ago

Last modified 8 months ago

SvnLastRevisionTask cannot get SVN revision number on single file

Reported by: lars.kermode@gmail.com Assigned to: hans
Priority: minor Milestone: 2.3.0
Component: phing-tasks-ext Version: 2.3.0RC1
Keywords: Cc:

Description

I need to get the SVN revision number of individual files (to build a querystring for the links to my JavaScript files in order to force reloading in the browser cache).

When setting the following:

  <svnlastrevision workingcopy="${project.basedir}/${js_a}/${js_a_sub}/${js_a_proto}" propertyname="svn.rev_a_prototype"/>

The following exception is generated:

[svnlastrevision] c:\php\PEAR\simple.xml:19:42: '<path>/js/prototype.js' is not a directory
[Exception in XML parsing]
exception 'BuildException' with message 'c:\php\PEAR\simple.xml:19:42: '<path>/js/prototype.js' is not a directory' in C:\php
\PEAR\pear\phing\tasks\ext\svn\SvnBaseTask.php:261
Stack trace:
#0 C:\php\PEAR\pear\phing\tasks\ext\svn\SvnLastRevisionTask.php(61): SvnBaseTask
->setup('info')
#1 C:\php\PEAR\pear\phing\Task.php(254): SvnLastRevisionTask->main()
#2 C:\php\PEAR\pear\phing\parser\TaskHandler.php(188): Task->perform()
#3 C:\php\PEAR\pear\phing\parser\AbstractHandler.php(80): TaskHandler->finished(
)
#4 C:\php\PEAR\pear\phing\parser\AbstractSAXParser.php(102): AbstractHandler->en
dElement('svnlastrevision')
#5 [internal function]: AbstractSAXParser->endElement(Resource id #504, 'svnlast
revision')
#6 C:\php\PEAR\pear\phing\parser\ExpatParser.php(129): xml_parse(Resource id #50
4, '<project name="...', 1)
#7 C:\php\PEAR\pear\phing\parser\ProjectConfigurator.php(91): ExpatParser->parse
()
#8 C:\php\PEAR\pear\phing\parser\ProjectConfigurator.php(58): ProjectConfigurato
r->parse()
#9 C:\php\PEAR\pear\phing\Phing.php(499): ProjectConfigurator::configureProject(
Object(Project), Object(PhingFile))
#10 C:\php\PEAR\pear\phing\Phing.php(164): Phing->runBuild()
#11 C:\php\PEAR\pear\phing\Phing.php(262): Phing::start(Array, NULL)
#12 C:\php\PEAR\pear\phing.php(41): Phing::fire(Array)
#13 {main}

The reason is SvnBaseTask checking that the workingCopy is a directory, which can be considered fair enough for update or commit, but too restrictive for info.

The attached patch enables checking that the workingCopy is a file, if it is not a directory and the mode is info.

Attachments

phing230_ext-svn-info-file.patch (0.6 kB) - added by lars.kermode@gmail.com on 10/25/07 18:23:47.
Patch to allow SVN info on files (as well as directories)

Change History

10/25/07 18:23:47 changed by lars.kermode@gmail.com

  • attachment phing230_ext-svn-info-file.patch added.

Patch to allow SVN info on files (as well as directories)

10/25/07 18:27:47 changed by hans

  • status changed from new to assigned.
  • milestone set to 2.3.0.

Thanks! -- I'll get this added for next RC or final release of 2.3.0.

11/02/07 09:20:11 changed by hans

  • status changed from assigned to closed.
  • resolution set to fixed.

Thank you. I have applied this patch in r281 (2.3) and r282 (trunk)


Add/Change #170 (SvnLastRevisionTask cannot get SVN revision number on single file)




Action