#5242 closed enhancement (fixed)
Plugins should use svn timestamps for accurate last-updated value
Reported by: | tellyworth | Owned by: | coreymckrill |
---|---|---|---|
Milestone: | Priority: | low | |
Component: | Plugin Directory | Keywords: | |
Cc: |
Description
Currently, the svn import script uses current_time()
as the value for a plugin's "last updated" timestamp. That's fine in most circumstances. But it gives an incorrect value in some cases, for example if the import script is run manually.
Ideally, it should use the Last Changed Date
as given by svn info
.
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
The above patch adds a new
info
method to theTools\SVN
class. It also refactors a portion of theexport_and_parse_plugin
method inCLI\Import
to use the new SVN method to find the correct location of the stable tag before running an export. Finally it uses the data from the new method to populate the plugin's "Last updated" timestamp.In testing, using bin/import-plugin.php, the "Last updated" was getting set to the correct value from the svn repo. One (possibly trivial) side benefit is that the refactor of the export process seems to have cut the time to process a single plugin in half--1.4 seconds vs 2.6 seconds on my sandbox.
This probably needs more testing before merge, especially to make sure there aren't any regressions in how
export_and_parse_plugin
handles edge cases. I'm not sure yet how best to find and test those edge cases though.