XF 1.2 Template Merging and History

In our second updating about template improvements, we're focusing on tools to make it easier to keep your changes up-to-date and to see what changes you've been making.

Template Merging
First up is the ability to merge changes into templates after upgrading XenForo, an add-on, or a distributable style.

This is done via the existing outdated template interface:

ss-2013-04-18_11-08-03.webp


You have the option to automatically merge changes if possible. This will merge any updates where a conflict is not detected. If a conflict is detected, you will need to use the manual merge interface, which you can access by clicking on "merge changes" for a template. Here's what you'll see:

ss-2013-04-18_11-09-34.webp


The yellow and blue highlighted blocks indicate the changes that are being brought in. Blue represents a successful, non-conflicted merge (either from the parent changes or your custom changes). Yellow represents a conflict and gives you options to deal with it. In this example, I probably want to use my custom version only, but there are situations where you may need to use both (such as changes adding buttons in the same location). Note that you cannot submit this form until you have resolved all conflicts.

What if you're not happy with the changes that are being merged? You can click on any blue (successfully) merged section or any yellow (conflict) section after you've selected a conflict-resolution method. This will turn the text into a textarea that you can type in:

ss-2013-04-18_11-09-46.webp

As soon as you leave the text box, it will turn back into text to improve readability.

Note that in this example, I selected "resolve using both" so you see both parts of the conflict there, which can then be edited. I selected this to demonstrate but in this case, resolving with both blocks doesn't really make sense.

I made reference to it above, but there have been some additional changes to how templates noted as being outdated. Previously, this system could only be used when updating XenForo or an add-on. If you have installed a third-party style and kept your changes in a child style, you wouldn't see any outdated templates if you updated the third-party style. With these changes, updating a templates in a parent style will mark child templates as outdated (if necessary).

In terms of the merging, we are using an algorithm to help us reduce conflicts as far as possible. I suspect that most changes will simply be mergeable automatically but that obviously varies based on what changes you've made to the style. Regardless, it should make upgrades with customizations much easier.

Template History
Along with these merging changes, we now also track template changes for a period of time (30 days by default, configurable via option). This can make it easier to revert bad changes if needed or simply see what changes you've been making.

You can see the history when editing a template:
ss-2013-04-18_11-23-07.webp


I've cut this off at the bottom, but as you would expect you can use the old and new options to compare changes from your individual edits.
 
Right, but I think it should be automatic, it's not obvious at all.

Wait, you can't do that and then use auto merging.
 
That link is the XF2 manual.

The concept is exactly the same as detailed in this thread and mentioned on that page.
 
That link is the XF2 manual.

The concept is exactly the same as detailed in this thread and mentioned on that page.
it is the manual, I know, but I do not understand it (and I used to be a php-coder / sql-database-designer for a couple of years)
Same goes for this thread: Nobody answered limboclubs question in Post #65 - that would be a start.

Buttons like this I understand:
1614893888304.webp

but there are not present in v2 anymore, are they?

Diff-views like in SVNs or in this: https://www.scootersoftware.com/features.php?zz=screenshot&shot=TextCompare I do understand (and use like twice a week) but this isn't available either?

And what is the message "The custom template is out of date but has been edited more recently than the parent. Merging can only be done by hand." suppose to help me? PLEASE Show me two links along with this to the one and the other version I have to merge.
 
The first post in this thread explains how to deal with that.
The yellow and blue highlighted blocks indicate the changes that are being brought in. Blue represents a successful, non-conflicted merge (either from the parent changes or your custom changes). Yellow represents a conflict and gives you options to deal with it. In this example, I probably want to use my custom version only, but there are situations where you may need to use both (such as changes adding buttons in the same location). Note that you cannot submit this form until you have resolved all conflicts.

It's also mentioned in the manual:
When you select the Merge link for a template that is listed as being outdated, you will see what the final, merged version of the template will be. Successfully merged sections will be highlighted in blue. Conflicting sections will be highlighted in yellow with buttons to help you resolve the conflict. Once you have resolved any conflict, you may click on the text to edit it to fit your exact needs.

If you require support with dealing with a particular situation, you will have to post in the relevant customer support forum.
 
Top Bottom