POFile export: move divergence handling into SQL
Bug #401608 reported by
Jeroen T. Vermeulen
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Triaged
|
High
|
Unassigned |
Bug Description
POFileToTransla
• The methods that fetch translation rows sort diverged messages to the front.
• _getMessages keeps a set of diverged messages it's already seen.
• When a non-diverged message is for a POTMsgSet for which it's already seen a diverged message, the non-diverged message is skipped.
The visible side effect of this is that exports don't strictly follow message-sequence order. Also, it means retrieving more rows than necessary.
Instead, we could move this into the SQL using "DISTINCT ON." That way we only fetch the applicable message: diverged if there is one, otherwise the shared one.
tags: | added: message-sharing |
To post a comment you must log in.
The order messages are returned in should be by translationtemp lateitem. sequence, translationmess age.potemplate, so order should still be correct. If it isn't, we can fix it without fixing this bug, if I am reading it correctly.
We should still move it to SQL, though, so that's where we can make the code look nicer.