The subject matter described herein relates to object-based merge tools for handling merge scenarios.
Extensible mark-up language (XML) files that contain metamodel-based metadata often require special treatment during merge scenarios, which typically occur during team development scenarios (e.g., check-in conflicts) or during upgrades of modified systems (e.g., integration conflicts). A check-in conflict may exist when two users work on a file or file set separately, then check-in their changed or unchanged versions into, e.g., a data transaction register (DTR) versioning system. The merging of these two versions of the original (or ancestor) file or file set creates a check-in conflict. An integration conflict may exist when a file or file set is released, but further development of the file or file set occur internally for the next release, while the file or file set that was released is modified. Then the next release of the file or file set occurs. In this case, the merging of these two different releases is simply an upgrade of a modified system and creates an integration conflict. In particular, the upgrade of modified systems on the customer side generally requires comprehensive tool support to reduce the complexity of the merge scenario and to help rule out inconsistencies caused during the merge operation.
Existing merge tools are text-based, which when used with XML files, are difficult to use and are not useful to prevent inconsistencies during a merge scenario. That is, existing merge tools are generally only capable of providing a textual representation of the differences in the metadata between XML files, which generally requires a user to still read the content of the XML file to determine the differences. Existing merge tools also do not provide any connection to a meta-model and/or to a versioning system.
The present inventors recognized that existing merge tools are text-based, which when used with XML files, are difficult to use and are not useful to prevent inconsistencies during a merge operation and do not provide any connection to a meta-model and/or to a versioning system. Consequently, the present inventors developed the subject matter described herein, e.g., an object-based merge tool, that is intuitive and easy to use. The object-based merge tool encapsulates metadata in XML files as model objects in accordance with an underlying metamodel, all of which can be graphically represented to the user. The model objects may be formed in a tree structure (or any other structure), which makes the semantical structure of the XML files clear to the user and easily understandable by the user. Additionally, with the graphical representation of the XML files (with their metamodel and model objects formed in a tree structure, for example), a user is able to see how the files have been changed. The differences between XML files or file sets can be graphically represented to the user, such as through markings of the model objects in the tree structure, and the differences can be explained in an additional view.
In one aspect, model objects to represent metadata of a selected file may be obtained. Optionally, attributes, such as a property and a value pair, may be assigned to each obtained model object. Each obtained model object may be associated with a corresponding tree node. Then the associated tree nodes may be displayed in a tree structure. Optionally, any one of the displayed tree nodes my be selected. Thereafter, attributes and associated values assigned to the model object associated with the selected tree node may be displayed.
In one variation, the displayed tree nodes are configured to represent metadata and/or relations between obtained model objects. Also, the displayed tree nodes may be collapsible or expandable so hide or show the tree nodes or model objects that are attached directly beneath the collapsible or expandable tree node.
In an interrelated aspect, a first model of a first file, a second model of a second file and a third model of a third file may be obtained. Thereafter, one or more differences between the first model and the third model and one or more differences between the second model and the third model may be determined. The first model and second model and at least one determined difference may then be displayed.
In one variation a first tree containing hierarchically arranged model objects of the first model and a second tree containing hierarchically arranged model objects of the second model may be displayed. Additionally, at least one of the determined differences may be displayed and graphically visualized by a decorator, a shape or a link or a combination of these graphical markings. Optionally, the hierarchically arranged model objects may represent a metadata of the first file and second file and correspond to one of the tree nodes. Thereafter, the tree nodes may be arranged corresponding to a structure of the metadata of the first file and second file. The arranged tree nodes may be displayed in a tree structure.
Computer program products, which may be embodied on computer readable-material, are also described. Such computer program products may include executable instructions that cause a computer system to conduct one or more of the method acts described herein.
Similarly, computer systems are also described that may include a processor and a memory coupled to the processor. The memory may encode one or more programs that cause the processor to perform one or more of the method acts described herein.
The subject matter described herein may provide one or more of the following advantages. The object-based merge tool provides an abstract and graphical view of the metadata of XML files or file sets to provide a better and more intuitive presentation of the differences between XML files. This view will aid in resolving the differences (i.e. conflict resolution) during team development (i.e., concurrent work on the same application metadata) and upgrades to modified systems. Furthermore, the object-based merge tool can support two-way and three-way merge scenarios and interact with a DTR versioning system.
The details of one or more implementations are set forth in the accompanying drawings and the description below. Other features and advantages will be apparent from the description and drawings, and from the claims.
Like reference symbols in the various drawings indicate like elements.
With continued reference to
The models may include a left model, a right model and an ancestor model. In a check-in conflict scenario, for example, the left model may be called “local” and the right model may be called “active”. The left (or local) and right (or active) models may be considered concurrent models because either may be designated the active model. The ancestor model is generally the latest common ancestor of the concurrent models.
The result of a comparison between models may be referred to as difference deltas. Each difference delta concerns a model object of one or both of the compared models. The difference deltas may be classified as applicable (or not), and if classified as applicable whether to be automatically applied (i.e., mergeable). Applicable deltas also may be classified by the way they behave when being applied.
If, for example, two models, such as the left (local) model and the ancestor model, are compared to determine the differences between them and the result of the comparison is determined to be to be applicable, then when each difference delta of the result is applied, the model object corresponding to the difference delta in both the left (local) model and the right (active) model are made equal by changing the model object in the left (local) model, which contains the result of the merge.
The difference deltas that are not applicable may be referred to as pseudo difference deltas, which may occur, e.g., where a difference between the ancestor model and the left (local) model is the same as a difference between the ancestor model and the right (active) model. For example, such a difference may occur where a model object X has been added in the left (local) model beneath a model object Y and the same addition occurred in the right (active) model. As such, there is actually no difference between the concurrent models with respect to the model object X beneath the model object Y. But since it typically is important for a user to know that the same change occurred in both models, the user may be made aware of this fact by graphically highlighting the same change to both models.
As noted above, applicable difference deltas may be classified as automatically applied (i.e., mergeable) or not, and if not, then the user needs to determine interactively whether to apply or merge the difference delta during the merge process. An automatically applied (or mergeable) difference delta may result where a concurrent difference delta results from a difference between the ancestor model and only one of the concurrent models (i.e., not both of them) without any conflict with difference deltas between the ancestor model and the other concurrent model. Thus, if an automatically applicable difference delta occurred in the right (active) model, then the delta will be applied, but if the automatically applicable difference delta occurred in the left (local) model, then the delta will not be applied. A set of settings controlling the specific properties of a difference delta, e.g., whether to be automatically applied (or mergeable) may be provided to the user. These settings can set by the user on, e.g., a preference page.
Difference deltas that are not automatically applicable (or mergeable) can occur where, e.g., a model object X is deleted on one model (e.g., the left model), while only a property of the model object X was changed on the other model (e.g., the right model). In this case, there is a conflict between the concurrent difference deltas as they both concern the same model object (i.e., model object X). Thus, for such difference deltas, the user needs to interactively decide during the merge process whether or not to accept the difference delta.
During the merge process, the difference deltas may be graphically represented or visualized differently in a graphical user interface, such as in a conflict viewer and/or in a properties area. For example, a color, style and icon may be used to visually distinguish each class of difference deltas.
As noted above, applicable difference deltas may also be classified by the way they behave when being applied, such as positive deltas, negative deltas, exchange deltas, property deltas and reordering deltas. Positive deltas occur when the right (active) model has an additional model object that does not exist at the corresponding location in the left (local) model. If this type of delta is applied, the positive delta will insert this additional model object into the corresponding location in the left (local) model. The model object to be inserted may be graphically or visually marked to indicate to the user the difference. If the positive delta is applied, then the model object exists in both models (i.e., the left model and the right model). In this case, the model object may be marked in both models and may be connected via a link.
Negative deltas can occur when the left (local) model has a model object that is missing at the corresponding location in the right (active) model. If this type of delta is applied, the negative delta will delete this model object in the left (local) model. The model object to be deleted may be graphically or visually marked to indicate to the user the difference. If the negative delta is applied, then the model object is deleted from the left (local) model, so it will no longer be visible to the user.
Exchange deltas can occur when the right (active) model has a model object that is different than the model object in the corresponding location in the left (local) model. If this type of delta is applied, the exchange delta will exchange the model object in the left (local) model with the model object in the corresponding location in the right (active) model. The model object to be exchanged exists in the left (local) model and the exchanging model object exists in the right (active) model. Both of these model objects may be graphically marked and connected via a link.
Property deltas can occur when the value of a property of a model object is different between the left (local) and right (active) models. If this type of delta is applied, the property delta will change the property in the left (local) model by copying the value from the right (active) model to the left (local) model. These model objects may be marked and connected via a link.
Reordering deltas can occur when the order of model objects is different between the left and right models. If this type of delta is applied, the reordering delta will change the order of the model objects by copying the order of the model objects in the right (active) model to the left (local) model. The model objects involved may be marked and connected via a link.
As seen in
As noted above, if any two models are compared, then the result is a set of difference deltas in each of the two compared models. The difference deltas between each of the concurrent model (left and right model) and the ancestor model, referred to as concurrent differences, are used to create a merged model that is the result of the merge process. Thus, at 508, the concurrent differences between the left model and the ancestor model are determined, and at 510, the concurrent differences between the right model and the ancestor model are determined.
Then, at 514, the concurrent differences are displayed, e.g., by graphically representing each difference delta in a graphical user interface, such as in a conflict viewer (e.g., a tree area) and/or in a properties area. A color, a style and an icon may be used to visually distinguish each type (or class) of current differences.
In the merge process described herein, the left (or local) model will be the merged model at the end of the process, but in other implementations of the merge process the right model may be the merged model. The left model is changeable because it may be persisted in a file or files on the local hard disk rather than in a remote file or remote files in the DTR. The differences between the ancestor model and each of the concurrent models depict how the concurrent differences originated and also help to explain each concurrent difference. Thus, at 518, based on the displayed current differences, a user can select either the left model or the right model as the desired model. At 520, if, based on the concurrent difference, the left (or local) model is the desired model, then, because the left model by default is the merged model, nothing remains to be done, and the difference may be considered resolved and the process proceeds to 524. On the other hand, at 520, if, based on the concurrent difference, the left model is not the desired model (i.e., at 518 the right model was selected as the desired model), then, at 522, that portion of the right model that causes the concurrent difference is copied to the left model so that there is no actual difference anymore. Once the copying is complete, the difference may be considered resolved and the process proceeds to 524. At 524, the left model is accepted as the merged model.
The graphical user interface 600 also includes a properties area 610 for displaying all properties of a currently selected node and associated model object, which in this case is “Test1View”. The properties area 610 may include an attribute(or property) name column 612, a first value column 614, which can be associated with the left (local) model), a second value column 616, which can be associated with the right (active) model, and a third value column (not shown), which can be associated with an ancestor model.
With continued reference to
The second decorators 644 may occur in the property name column 612 of the properties area 610. The second decorators 644 denote a difference delta of the current property displayed, which in this case is “codeBody”. The second decorators 644 correspond to shapes 648 and links 650. The shapes 658 are visualizations of a difference delta concerning only one node in one conflict viewer, e.g., either the left conflict viewer 606 or the right conflict viewer 608. The links 650 are visualizations of the connection between two shapes, one for a node in the left conflict viewer 606 and one for a node in the right conflict viewer. All difference deltas concerning a node in the left conflict viewer 606 and a node in the right conflict viewer 608 can be visualized by two shapes 648 for the nodes and a link 650 between them.
The graphical user interface 600 also includes a top line tool bar 618 that contains, for example, toggle buttons, such as a “set new root” button 620, an ancestor button 622, a two-way button 624, an “accept left” merge button 626, a “reset conflict”0 merge button 628, an “accept right” merge button 630, an “auto merge” button 632, a “navigate to next conflict” button 634, a “navigate to previous conflict” button 636, an undo button 638, and a redo button 640. The “set new root” button 620 can be used for tree structured models and associated with an action to set an inner node of each tree in the left model and the right model (and ancestor model) as a new root for all trees in order to view a part of the model instead of the entire model. The ancestor button 622 can be used to show and hide the top conflict viewer (not shown) with the ancestor model. If the ancestor button 622 is activated, e.g., my moving a cursor over the button with in input device such as a mouse and clicking the left mouse button, then the top conflict viewer and associated ancestor model are shown above the left conflict viewer 606 and the right conflict viewer 608. Moreover, the third value column 616 is shown in the properties area 610 if the button 620 is activated. The two-way button 624 can be used to switch to a two-way merge mode. In this mode, the common ancestor is not shown and can not be shown. The properties area 610 will show only the first value column 614 and the second value column 615, and decorators 642, 646, 648 are not displayed.
The “accept left” merge button 626 can be used to resolve a current conflict, i.e., there is a difference delta associated with a tree node/model object. As described above with reference to
The auto merge button 632 can be used to perform a specific action for all auto-mergeable deltas. The “navigate to next conflict” button 634 can be used to navigate to the next conflict of interest in a forward direction. Similarly, the “navigate to previous conflict” button 636 can be used to navigate to the next conflict of interest in a backward direction. A user can set up a preference page specifying whether all difference deltas are navigated, whether only applicable difference deltas are navigated, or whether the difference deltas requiring user interaction are navigated. The undo button 638 can be used for undoing the last merge action, while the redo button 640 can be used for redoing the last merge action.
The graphical user interface 600 also includes a properties tool bar 619 that contains, for example, an “accept left property” merge button 650, a “reset property conflict” merge button” 652, an “accept right property” merge button 654, and a “Long text property” merge button 656. The “accept left property” merge button 650 can be used to resolve the current property conflict, which can be done by accepting the left value of this property of the currently selected node. As the left model is the result model, nothing is changed. Similarly, the “accept right property” merge button 654 can be used to resolve the current property conflict, which can be done by accepting the right value of this property of the currently selected node. As the left model is the result model, the value of the property of the right model object is copied into the left model object. The “reset property conflict” merge button 652 can be used to un-resolve the currently selected property conflict. As the left model is the result model, the original value of the property on the left side is restored if necessary. The “long text property” merge button 656 can be used to open a modal dialog, perform a textual merge with arbitrary result (of type String) and set the difference delta to resolved.
Thus, as can be seen in
Also, with the framework described in
Various implementations of the subject matter described herein may be realized in digital electronic circuitry, integrated circuitry, specially designed ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various implementations may include implementation in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software, software applications or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the term “information carrier” comprises a “machine-readable medium” that includes any computer program product, apparatus and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal, as well as a propagated machine-readable signal. The term “machine-readable signal” refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the subject matter described herein may be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user may provide input to the computer. Other kinds of devices may be used to provide for interaction with a user as well; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The subject matter described herein may be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a client computer having a graphical user interface or a Web browser through which a user may interact with an implementation of the subject matter described herein), or any combination of such back-end, middleware, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (“LAN”), a wide area network (“WAN”), and the Internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
Although a few variations have been described in detail above, other modifications are possible. For example, steps in a flow diagram may be replaced with other steps, additional steps may be added, some steps optionally may be removed, and/or steps may be performed in a different order, or in parallel, relative to the order depicted. Accordingly, other embodiments are within the scope of the following claims.