Closed Bug 513636 Opened 16 years ago Closed 16 years ago

[silme] 3way-merge script fails to properly catch a few cases

Categories

(Mozilla Localizations :: Infrastructure, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sethb, Assigned: zbraniecki)

Details

Script builds a diff between en-US 3.0 and en-US 3.6 and then it applies it on ab-CD 3.0. The way it stores the diff is in units looking like this ('Entity XYZ', position=('after', 'Entity ZYX')). Since we are adding new entities in a commented out mode, the script fails to be able to locate where to add the new entity if it's being added after commented out entity.
I'm working on this for a few days now. The goal is to clean the whole script and make it work with the approach of adding all new entities in the commented out state. I reorganized code in the script to match silme 0.8alpha version and it works pretty nice. While reorganizing I got to the point when I realized that by the concept of "3 way merge" we can understand two different algorithms: (org1,org2 - original old and new, res - target) 1) An algorithm that takes org1.diff(org2) and applies it on res (as "fuzzy"). 2) An algorithm that takes res.diff(org2) and applies it on res plus it takes org1.diff(org2) and marks modified entities as "fuzzy" in res. The former solution is more sophisticated. We only apply what changed between org1 and org2. If target package misses something, we don't force-add it. The latter approach is more "brute force" and it's a "catch-all" solution. If there's something missing in target package, it'll be added. A result in former case will be exactly what you asked for. target package with all changes that happened between org1 and org2. In most cases it just requires you to make sure that org1 and res are in fact identical, but in some edge cases it may be nicely exploited if you want (for example you want to apply diff between en-US3.5 and en-US3.6 on ab-CD3.0 and it will apply ONLY those changes). A result in latter case is more "brute-force" - we fix the damn thing. We don't care if there was something missing, something different or something unique. We flatten all of this with a roller and make sure that at the end we have a package that is identical as org2 but with org1.diff(org2) modified things marked as such with a nice "value_old -> value_new" comment. Pike, do you think its worth keeping both approaches or should we stick to one?
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
I'd call the brute-force one an "import", and the other a merge. There might be use cases for import, but there are edge cases like license headers and such that make me frown upon it.
http://hg.mozilla.org/users/zbraniecki_mozilla.com/silme-apps/rev/b40058006a9c this gives us first usable 3way merge that comments out each and every new entity. The localizers has to look for "<!--l10n merge" or "#l10n-merge" to find pieces he has to uncomment and translate. 3way import is on the way.
fixed in 0.8 and in wanna-be 0.9
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.