Wiki source code of History

Last modified by Thomas Mortagne on 2023/10/10

Hide last authors
Vincent Massol 30.2 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
Vincent Massol 30.4 5 In XWiki, everything is historized and saved under Version Control.
6
Vincent Massol 30.3 7 = History View =
8
Vincent Massol 62.1 9 When looking at a page you can see who last modified it and the time the change was performed:
Vincent Massol 5.3 10
Silvia Macovei 12.4 11 {{image reference="versioncontrol1.png"/}}
Vincent Massol 1.1 12
Vincent Massol 62.1 13 You can see the versions of a page by looking at the "History" tab at the bottom. For example, on the following screenshot the last version is 8.1 and has been modified by "Administrator".
14
15 {{image reference="extensionhistory-list.png"/}}
Silvia Macovei 16.1 16 //"History" as it appears using the Flamingo Skin//
Silvia Macovei 11.6 17
Thomas Mortagne 81.1 18 The page version consists of two numbers, separated by a dot: ##<Major>.<Minor>##. The XWiki versioning system allows the distinction between major and minor edits. When [[editing a page>>Documentation.UserGuide.Features.PageEditing]], the user has the option to decide whether his/her edit brings major or minor changes to the page. Saving a major version will increase the first component and reset the second to "1", while a minor version will just increase the second component.
Sergiu Dumitriu 6.1 19
Sergiu Dumitriu 9.1 20 Clicking on the "History" button when viewing a page displays all the versions that were previously saved:
Vincent Massol 1.1 21
Vincent Massol 62.1 22 Besides listing the page versions, the history page can be used to perform other actions as well:
Vincent Massol 1.1 23
Vincent Massol 62.1 24 * View a previous version of the page
25 * Compare any two versions
26 * Set an older version as the current version (rollback); available only if the user has edit rights on the page
27 * Delete a version completely from the history (useful for removing spam, for example); available only if the user has administration rights
28 * Delete an entire version range from the history; also available only if the user has administration rights
Silvia Macovei 10.1 29
Jean-Sébastien Dennebouy 76.1 30 By default, minor edits do not appear in the page history. The option "Show minor edits" will list all the versions, including minor ones. To know more about minor and major edits, have a look at the [[Page Editing>>Documentation.UserGuide.Features.PageEditing#HCommoneditactions]] documentation page.
Vincent Massol 1.1 31
Vincent Massol 79.1 32 The history also displays, on the first line, the standard version of the page, as contained by the installed Extension (if the page comes from an extension), in that installed version. This can be different from the first version of the page (v1.1) since the page could have had edits before an extension was installed that modified the page or if the extension has been upgraded.
Eduard Moraru 26.1 33
Michael Hamann 80.1 34 {{version since="14.10.7,15.2RC1"}}
35 When viewing a previous version of the page, the content of that previous version is rendered in a special "restricted" mode that prevents the execution of script macros and other dangerous macros to avoid that old code that might have contained problems is executed even though it has been fixed in the current version of the page. This may lead to errors being displayed and other differences in behavior to the current version.
36 {{/version}}
37
Vincent Massol 30.3 38 = Comparing Versions =
Eduard Moraru 26.1 39
Marius Dumitru Florea 72.1 40 The comparison between two page versions can be done either on the **raw** content or (since XWiki 11.6RC1) on the **rendered** content.
Vincent Massol 1.1 41
Marius Dumitru Florea 72.1 42 In order to compare 2 versions you need to select one of the radio buttons corresponding to the version from which you want to start the comparison. These are the buttons located in the "From" column. You will then need to select the button corresponding to the version you want to compare the previously selected version against. These buttons are located in the "To" column. You may choose to include minor edits in the comparison. After selecting the 2 versions you wish to compare you will need to click on "Compare selected versions".
Silvia Macovei 11.6 43
Marius Dumitru Florea 73.1 44 Clicking on either one of the 2 compared version numbers (shown on the header) will display that version of the page.
Marius Dumitru Florea 72.1 45
Jean-Sébastien Dennebouy 76.1 46 == Raw Changes ==
Marius Dumitru Florea 72.1 47
48 The raw changes between two page versions highlights the differences between page properties (title, content, parent, syntax, etc.), attachments, objects and class properties. Depending on the changes you have made you will get a result similar to this:
49
Silvia Macovei 12.4 50 {{image reference="versioncontrol3.png"/}}
Vincent Massol 62.1 51 //"Changes for page" as they appear using the Flamingo Skin //
Marius Dumitru Florea 20.1 52
Vincent Massol 80.3 53 Note that the comparison starts with a Summary that groups the changes in 4 categories: Page Properties, Attachments, Objects and Class Properties. A category is displayed only if there are related changes. Except for 'Page properties', the rest of the categories can be expanded to see which items have been added, deleted or modified. Each item provides a link to the details that are listed below the Summary.
Marius Dumitru Florea 20.1 54
Vincent Massol 80.3 55 The comparison details lists all the items (page properties, attachments, objects, class properties) that have been added, deleted or modified. For each item you can see what properties have been modified and the exact modifications. For text attachments you can even see the changes made to the attachment content between two versions of the attachment. The changes made to the object properties of type Password and Email are obfuscated for privacy reasons.
Thomas Mortagne 23.1 56
Marius Dumitru Florea 72.1 57 == Rendered Changes ==
Eduard Moraru 30.1 58
Vincent Massol 80.2 59 You can view how the page has changed visually from one version to another. The changes are computed on the rendered page content. The parts of the content that have not been modified are hidden by default but you can click on each ellipsis to view more context or you can use the "Show context" button to view the entire page content.
Marius Dumitru Florea 72.1 60
Michael Hamann 80.1 61 {{version since="14.10.7,15.2RC1"}}
62 Similar to the behavior when viewing a previous version of a page, the content of previous versions is executed in a "restricted" mode that might lead to errors and other differences.
63 {{/version}}
64
Marius Dumitru Florea 72.1 65 {{image reference="renderedChanges.png"/}}
66
Adel Atallah 70.1 67 == Show next/previous changes ==
68
Vincent Massol 80.2 69 You can change the versions directly while comparing two page versions, using the arrows depicted in the image below.
Adel Atallah 70.1 70
Adel Atallah 71.1 71 By clicking on the leftmost arrow, you will see the previous change made before the "From" version. For example, if the current comparison is between revision 4.1 and 6.1, clicking the left arrow would compare revisions 3.1 and 4.1 (assuming there are no minor versions). Similarly, the next change will be displayed by clicking the rightmost arrow (e.g. clicking the right arrow while comparing revision 3.1 and 5.1 will lead to 5.1 and 6.1 comparison). You can also use the arrows around a version to increase or decrease the associated version number.
Adel Atallah 70.1 72
73 [[image:change-versions.png]]
74
Vincent Massol 30.3 75 = Viewing Previous Versions =
Eduard Moraru 26.1 76
Vincent Massol 62.1 77 By clicking on a version from the ##Version## column of a page's ##History## tab you will be able to view that page's content, as it was in the selected version:
Eduard Moraru 26.1 78
Eduard Moraru 28.1 79 {{image reference="view-version.png"/}}
80
Vincent Massol 62.1 81 In this view, most actions on the page will actually affect the latest version of the page. However, the following actions (under the "More Actions" menu) will target the current version of the page you are viewing:
Eduard Moraru 28.1 82
83 * Export
84 * Print Preview
85 * View Source
Eduard Moraru 35.2 86
87 = Blame View =
88
Vincent Massol 80.3 89 When viewing the source of a page (by going to ##More Actions > View Source## on a page), you can enable the blame view by clicking on ##Show last authors## button. In this mode, each line of the page's content is annotated with the last author that modified it and the revision in which this modification was introduced. The blame view also works when viewing the source of a page revision (other than the latest one) so it can be accessed at any point in the history of a page.
Eduard Moraru 35.2 90
Vincent Massol 36.1 91 {{image reference="codeViewer-blameView.png"/}}
Eduard Moraru 35.2 92
93 Hovering the avatar and the revision number will display the author's name and the date and time when the line was changed. Multiple lines can be grouped to express the fact that they were all modified within the same revision (by the same author and at the same time).
94
Vincent Massol 36.1 95 {{image reference="codeViewer-blameView-author.png"/}}
96 {{image reference="codeViewer-blameView-versionAndDate.png"/}}
Eduard Moraru 35.2 97
98 Clicking on the revision number will display the changes view, with all the modifications performed in that particular change by its author.
99
Vincent Massol 36.1 100 {{image reference="codeViewer-clickingTheVersion.png"/}}
Eduard Moraru 35.2 101
102 At this point, if you still have not found the change you were looking for related to a particular line of content, you could continue the search by clicking on the parent (left) version, opening the blame view for it and repeating the cycle. This way you can drill down the history and focus on the content and find out, for example, when exactly was a line added, in which context and by whom.

Get Connected