POFile export: move divergence handling into SQL

Bug #401608 reported by Jeroen T. Vermeulen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

POFileToTranslationFileDataAdapter._getMessages handles divergence as follows:
 • 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.

Revision history for this message
Данило Шеган (danilo) wrote :

The order messages are returned in should be by translationtemplateitem.sequence, translationmessage.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.

Changed in rosetta:
status: New → Triaged
importance: Undecided → High
tags: added: cleanup
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

I concur. Right now, sharing affects the order in which messages are exported and it's confusing.

tags: added: message-sharing
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.