Is something wrong with svn_info() ?

Bale

Minion
Code:
[COLOR="#808000"]> ash svn_info("batbrain")[/COLOR]

Returned: record {string url; int revision; string lastChangedAuthor; int lastChangedRev; string lastChangedDate}
url => https://svn.code.sf.net/p/batbrain/code
revision => 36
lastChangedAuthor => zarqon
lastChangedRev => 36
lastChangedDate => 2014-03-16 01:38:13 EDT (Sun, 16 Mar 2014)

[COLOR="#808000"]> ash svn_info("batbrain").url[/COLOR]

Returned: https://svn.code.sf.net/p/batbrain/code

[COLOR="#808000"]> ash svn_info("batbrain").revision[/COLOR]

Returned: 36

Okay, so far so good. Then things break down

Code:
[COLOR="#808000"]> ash svn_info("batbrain").lastChangedAuthor[/COLOR]

[COLOR="#FF0000"]Invalid field name 'lastChangedAuthor' ()[/COLOR]
Returned: void

[COLOR="#808000"]> ash svn_info("batbrain").lastChangedRev[/COLOR]

[COLOR="#FF0000"]Invalid field name 'lastChangedRev' ()[/COLOR]
Returned: void

[COLOR="#808000"]> ash svn_info("batbrain").lastChangedDate[/COLOR]

[COLOR="#FF0000"]Invalid field name 'lastChangedDate' ()[/COLOR]
Returned: void

How do I access lastChangedRev?
 

Bale

Minion
Looking more closely there appears to be an error in the record definition. Should there be a semi-colon after lastChangedDate?
 

Veracity

Developer
Staff member
It's the only ASH function that returns a record. That should probably be changed.
item_drops_array returns an array of custom records.
maximize can return an array of custom records.

Looking more closely there appears to be an error in the record definition. Should there be a semi-colon after lastChangedDate?
Well, yes. But that's just the documentation string.

Turns out that camel case field names don't work. It's not ASH-like, anyway. I changed the definition and got this:

> ash svn_info("batbrain")

Returned: record {string url; int revision; string last_changed_author; int last_changed_rev; string last_changed_date;}
url => https://svn.code.sf.net/p/batbrain/code
revision => 36
last_changed_author => zarqon
last_changed_rev => 36
last_changed_date => 2014-03-16 01:38:13 EDT (Sun, 16 Mar 2014)

> ash svn_info("batbrain").last_changed_author

Returned: zarqon
Revision 14193
 

Bale

Minion
Thanks, Veracity. Once again, you're my hero.

PS. Hard to believe I'm actually the first one to have a use for this, eh?
 
Top