View RSS Feed

Mike Sullivan

vB 4.0: Template Merging and 3-Way Comparison

Rating: 5 votes, 5.00 average.
by Mike Sullivan on Fri 30th Jan '09 at 10:12am (11695 Views)
One of the most common complaints about vBulletin's upgrade process is applying the template changes. While the template history feature helped a little bit, it didn't go far enough. vBulletin 4.0 will introduce a feature to make applying template changes much easier: automatic merging and 3-way comparison.

Whenever you upgrade, we will automatically look for templates that have changed and see if you customized those templates. If you have, we will automatically try to merge the changes in. If this succeeds, you won't have anything else to do (in most cases). If it fails, your customized template won't be updated--like in vBulletin 3--and you'll have to apply the changes yourself. However, that process is improved as well. More on that later.

Roughly, the merging process goes like this:
  • Find the differences between the old default and the new default. ("old-new")
  • Find the differences between the old default and your customized version. ("old-custom")
  • Start walking through the template. If we find a changed spot in old-new but it's not changed in old-custom, use the old-new version. If we find a change in old-custom but not old-new, use the old-custom version. If neither changed, use either. If both changed, that's a conflict and we can't do the merge.
If you're interested in more technical details, check out this page or this university paper.

Most of this happens behind the scenes. However, you'll see some changes to the "Find Update Templates" screen:
Attachment 330

The "View Highlighted Changes" link will take you to this page:
Attachment 328
This lets you view the 3-way merge results visually. The yellow lines indicate areas changed by merging, while the red blocks indicate conflicts. The conflicting areas show you the values in all 3 versions of the template (old, new, customized) to let you choose how to resolve it.

Of course, trying to do the edit from this page would be a challenge, so if you click the "Edit Merged Text" link, you'll be taken to a normal looking template editor:
Attachment 329
However, the text that you're editing is slightly different from the norm. Any unchanged or merged areas are as you'd expect, but the output from a conflict is very different. All 3 possible values for a conflict will be shown, so you can resolve it correct. And don't worry, if you try to save it while there's still a conflict, it will warn you.



I should note that the automatic merging is pretty conservative. "Adjacent updates" (when a customized version adds a line immediately after a line that was changed) will trigger a conflict. In some cases, it'd be ok for this merge to go through, but there are other situations where things would break if the change were applied. Regardless, the new conflict management system should allow you to resolve the problem more quickly.

Hopefully this feature will make upgrading a customized vBulletin easier!
Submit "vB 4.0: Template Merging and 3-Way Comparison" to Digg Submit "vB 4.0: Template Merging and 3-Way Comparison" to del.icio.us Submit "vB 4.0: Template Merging and 3-Way Comparison" to StumbleUpon Submit "vB 4.0: Template Merging and 3-Way Comparison" to Google Email Blog Entry
Tags
4.0, merging, templates, vbulletin
Categories
vBulletin

Comments

Page 1 of 2
FirstFirst 1 2 ... LastLast
  1. DoE -
    DoE's Avatar
    Excellent news Mike. I know this feature will make a lot of Admins happier when updates occur.

    btw: I could not help but notice "4.0.0 Alpha 2" in the screen shot, it looks like 4.0 is coming along at a good pace.
  2. Mike Sullivan -
    Mike Sullivan's Avatar
    Ignore the version numbers. I actually hacked them up with Firebug so they'd make more sense than what was there.

    (The examples were created with some hand-manipulated style XML, so some of the version numbers really didn't make sense. )
  3. DoE -
    DoE's Avatar
    Ahhh well, but it did give me a moment of excitement.

    I must say, every post made about 4.0 is really making me look more forward to getting it.
  4. kmike -
    kmike's Avatar
    Awesome! Though our template changes are taken care of by the merging algorithm in git, it's a welcome feature nonetheless.
  5. Redseal -
    Redseal's Avatar
    This is an awesome feature, nice work. Thanks for the update.
  6. pipedreams -
    pipedreams's Avatar
    WOW, this would make upgrades MUCH easier!
  7. Temptations -
    Temptations's Avatar
    This is good. Will help converting skins easier.
  8. ThorstenA -
    ThorstenA's Avatar
    This feature saves me a lot of time and therefore money. Thanks for this great idea!
  9. Dannykilla -
    Dannykilla's Avatar
    awesome feature!
  10. Razasharp -
    Razasharp's Avatar
    Funny you should post this as I am just using the template history feature!

    I think it's a great addition for most users out there, especially if it lets you ok the changes first. Nice work!
  11. Dean C -
    Dean C's Avatar
    Whilst I think this is a good move in terms of making upgrading easier, your average user won't know anything about diff or its terminology. I would certainly consider changing the way the conflicts are displayed in the template editor to use more user-friendly language
  12. Lizard King -
    Lizard King's Avatar
    Maybe it is way off topic but are you guys going to prepare new style fulled with tables again ?
  13. Ryan Ashbrook -
    Ryan Ashbrook's Avatar
    Awesome, Template Updates are a pain in the ass, so this will help greatly.
  14. pod -
    pod's Avatar
    Seems pretty nice!

    I'd like to see some enhancements to the template hook system as well (together with the way to use them in plugins, getting rid of eval's and so). But of course template hooks aren't enough alone since they will probably only allow to add stuff, not to modify, which is what most hardcore modified styles do, so this is indeed a very welcome feature.
  15. Gladius -
    Gladius's Avatar
    Nice, though even the current system is already quite good.
  16. Chelf12 -
    Chelf12's Avatar
    This is a nice additon. Question though, Mike. What about Template Edit MODs? I assume you will still have to do the edits yourself? Stupid question, I know, but still curious.
  17. ---MAD--- -
    ---MAD---'s Avatar
    Very interesting. A bit confusing to grasp at first though.
  18. Fusion -
    Fusion's Avatar
    Great post, Mike. Thanks for sharing.
  19. Floris -
    Floris's Avatar
    @Lizard King
    Yes, that is a bit off topic. Perhaps best suited for 'new style' blog entries, if any are made.
  20. Rene Kriest -
    Rene Kriest's Avatar
    That's a pretty cool and helpful feature.

    However I would like to see a function to list all changes to a style. I hardly remember all my changes.
Page 1 of 2
FirstFirst 1 2 ... LastLast
Total Trackbacks 0

Trackbacks

Trackback URL: