CN108073501B - Code conflict detection method and device - Google Patents

Code conflict detection method and device Download PDF

Info

Publication number
CN108073501B
CN108073501B CN201611001045.6A CN201611001045A CN108073501B CN 108073501 B CN108073501 B CN 108073501B CN 201611001045 A CN201611001045 A CN 201611001045A CN 108073501 B CN108073501 B CN 108073501B
Authority
CN
China
Prior art keywords
conflict
code
codes
changed
working area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611001045.6A
Other languages
Chinese (zh)
Other versions
CN108073501A (en
Inventor
李兆伟
许玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201611001045.6A priority Critical patent/CN108073501B/en
Publication of CN108073501A publication Critical patent/CN108073501A/en
Application granted granted Critical
Publication of CN108073501B publication Critical patent/CN108073501B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3608Software analysis for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The method comprises the steps of monitoring whether a code of a local working area is changed or not through a daemon process, and generating a corresponding change conflict record when the code of the local working area is monitored to be changed, wherein the conflict record comprises a changed code and other codes which have a dependency relationship with the changed code; and then, merging and compiling the modified code and other codes with dependency relationship with the modified code to obtain a compiling result, then judging whether the compiling result has conflict, if so, simultaneously sending conflict notice to a working area where the modified code is located and a working area where other codes with dependency relationship with the modified code are located, so that the modified code and other codes with dependency relationship with the modified code can be cooperatively modified in time, thereby not only reducing the workload of developers, but also effectively improving the efficiency of cooperative development.

Description

Code conflict detection method and device
Technical Field
The present application relates to the field of computers, and in particular, to a method and an apparatus for detecting code conflicts.
Background
In the prior art, in the process of collaborative development of a technical team, because a plurality of development team personnel are relatively provided, a problem of code conflict is often encountered when submitting codes, for example, a developer P and a developer M modify a certain source file simultaneously, or modify source codes with a call close coupling relationship therebetween simultaneously, when they attempt to submit to a remote warehouse, a prompt is given to solve the conflict, and the developers need to perform human intervention. In a traditional collaborative development mode, different developers firstly pull the latest codes of development branches from a remote warehouse, after the development of a local working area completes corresponding functions, the developers need to pull the update of branch increments from the remote warehouse again, automatic merging is tried in the local working area, and the developers are prompted to solve conflicts.
As shown in fig. 1, in a conventional collaborative development manner, a developer P and a developer M perform collaborative development, and simultaneously pull source. Wherein, in the development process, a developer P modifies the parameter definition of a function A, changes the parameter definition of the function A from 1 entry into a to 3 entries a, B and c, and completes the development and implementation of the function A according to the latest parameter definition, meanwhile, a developer M is developing and implementing a function B, only 1 entry is prepared for calling the function A, the developer P does not know that the parameter definition of the function A has been modified by the developer P, then, the developer P is supposed to first pull the latest code increment of the function A of a remote warehouse to update and submit the code to a local branch, and finally, the code is pushed to a remote warehouse, the developer M does not receive the notification that the parameter definition of the function A has been modified all the time in the whole process, the developer M also writes the program implementation of the function B according to the structure of 1 entry, when trying to pull the latest code increment of the function B of the remote warehouse to update and submit the code to the local branch, the developer M can encounter conflict and compiling errors, the function B cannot find the function A with only one parameter, the developer has to solve the conflict and change the function B which is realized and completed by the developer M to provide more parameters for the function A, and the developer M can redevelop the realized module and has great influence on development progress. Similarly, suppose that the developer M first pulls the latest incremental update of the function B of the remote repository and submits the code to the local branch, and finally pushes the code to the remote repository, after the developer P completes the implementation of modifying the function a, when trying to pull the incremental update of the function B of the remote repository and submit the code to the local branch, the developer P also encounters a conflict and a compilation error, the function B cannot find the function a with only one entry, the developer P has to look up the code implementation of the developer M for the function B, and actively inform the developer M of making a corresponding code modification, which also has a great influence on the development progress.
Therefore, by adopting the conventional collaborative development method, the modified code cannot be predicted among developers and is adjusted accordingly, so that the collaborative development efficiency is low and the workload is large.
Content of application
An object of the present application is to provide a code conflict detection method and device, which solve the problems of low collaborative development efficiency and large workload caused by adopting a conventional collaborative development manner.
According to one aspect of the application, a code conflict detection method is provided, which is applied to a server where a remote warehouse is located, and the method includes:
monitoring whether a code of a local working area is changed or not, and generating a corresponding change conflict record when the code of the local working area is monitored to be changed, wherein the conflict record comprises the changed code and other codes which have a dependency relationship with the changed code;
merging and compiling the modified code and other codes which have a dependency relationship with the modified code to obtain a compiling result, judging whether the compiling result has conflict, and if so, sending a conflict notice to a working area where the modified code is located.
Further, in the above method, the monitoring whether the code of the local work area is changed includes:
and monitoring whether the code of the local working area is changed or not through the daemon process.
Further, in the above method, the sending a conflict notification to the workspace where the changed code is located includes:
and sending conflict notifications of different levels to the working area where the changed code is located according to the submission stage where the changed code is located.
Further, in the above method, when sending a conflict notification to the work area where the changed code is located, the method further includes:
and sending a conflict notice to the working area where other codes which have the dependency relationship with the changed codes are located.
Further, in the above method, the sending a conflict notification to a work area where another code that has a dependency relationship with the changed code is located includes:
and sending conflict notifications of different levels to the working areas where other codes with the dependency relationship with the changed codes are located according to the submission stage of the changed codes.
Further, in the above method, after determining whether the compiling result has a conflict, the method further includes:
and if no conflict exists, deleting the change conflict record.
Further, in the above method, after sending the conflict notification to the workspace where the modified code is located, the method further includes:
receiving feedback of conflict resolution based on the conflict notification from a workspace in which the changed code is located;
and deleting the corresponding change conflict record according to the feedback of the conflict resolution.
Further, in the above method, after sending the conflict notification to the workspace where the modified code is located, the method further includes:
checking whether the change conflict record exists at preset time intervals,
and if so, sending a conflict notice to the working area where the changed code is located again.
Further, in the above method, the sending the conflict notification to the working area where the changed code is located again includes:
and sending conflict notifications of different levels to the working area where the changed code is located again according to the submission stage where the changed code is located.
Further, in the above method, while sending a conflict notification to the working area where the changed code is located, the method further includes:
and sending the conflict notice again to the working areas where other codes with the dependency relationship with the changed codes are located.
Further, in the above method, the sending a conflict notification again to a work area where another code that has a dependency relationship with the changed code is located includes:
and sending conflict notifications of different levels to the working areas where other codes with the dependency relationship with the changed codes are located again according to the submission stage of the changed codes.
According to another aspect of the present application, there is provided a code collision detection apparatus applied to a server where a remote repository is located, the apparatus including:
the system comprises a monitoring device and a control device, wherein the monitoring device is used for monitoring whether a code of a local working area is changed or not, and generating a corresponding change conflict record when the code of the local working area is monitored to be changed, wherein the conflict record comprises a changed code and other codes which have a dependency relationship with the changed code;
and the merging and compiling device is used for merging and compiling the modified code and other codes which have a dependency relationship with the modified code to obtain a compiling result, judging whether the compiling result conflicts, and if so, sending a conflict notice to a working area where the modified code is located.
Further, in the above apparatus, the monitoring device is configured to:
and monitoring whether the code of the local working area is changed or not through the daemon process.
Further, in the above apparatus, the merging and compiling device is configured to:
and sending conflict notifications of different levels to the working area where the changed code is located according to the submission stage where the changed code is located.
Further, in the foregoing apparatus, the merging and compiling device is further configured to:
and sending a conflict notice to the working area where other codes which have the dependency relationship with the changed codes are located.
Further, in the above apparatus, the merging and compiling device is configured to:
and sending conflict notifications of different levels to the working areas where other codes with the dependency relationship with the changed codes are located according to the submission stage of the changed codes.
Further, in the foregoing apparatus, the merging and compiling device is further configured to:
and if no conflict exists, deleting the change conflict record.
Further, in the foregoing apparatus, the merging and compiling device is further configured to:
receiving feedback of conflict resolution based on the conflict notification from a workspace in which the changed code is located;
and deleting the corresponding change conflict record according to the feedback of the conflict resolution.
Further, in the foregoing apparatus, the merging and compiling device is further configured to:
checking whether the change conflict record exists at preset time intervals,
and if so, sending a conflict notice to the working area where the changed code is located again.
Further, in the above apparatus, the merging and compiling device is configured to:
and sending conflict notifications of different levels to the working area where the changed code is located again according to the submission stage where the changed code is located.
Further, in the foregoing apparatus, the merging and compiling device is further configured to:
and sending the conflict notice again to the working areas where other codes with the dependency relationship with the changed codes are located.
Further, in the above apparatus, the merging and compiling device is configured to:
and sending conflict notifications of different levels to the working areas where other codes with the dependency relationship with the changed codes are located again according to the submission stage of the changed codes.
According to another aspect of the present application, there is also provided a computing-based device comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
monitoring whether a code of a local working area is changed or not, and generating a corresponding change conflict record when the code of the local working area is monitored to be changed, wherein the conflict record comprises the changed code and other codes which have a dependency relationship with the changed code;
merging and compiling the modified code and other codes which have a dependency relationship with the modified code to obtain a compiling result, judging whether the compiling result has conflict, and if so, sending a conflict notice to a working area where the modified code is located.
The method comprises the steps of monitoring whether a code of a local working area is changed or not, and generating a corresponding change conflict record when the code of the local working area is monitored to be changed, wherein the conflict record comprises the changed code and other codes which have a dependency relationship with the changed code; then, merging and compiling the modified code and other codes which have dependency relationship with the modified code to obtain a compiling result, then judging whether the compiling result has conflict, if so, sending a conflict notice to a working area where the modified code is located, and simultaneously sending a conflict notice to a working area where other codes which have dependency relationship with the modified code are located, so that the working area where the modified code is located and the working area where other codes which have dependency relationship with the modified code are located correspondingly modify and adjust the modified code and other codes which have conflict, thereby not only effectively saving the time of modifying the modified code and other codes which have dependency relationship with the modified code by developers, but also reducing the code rewriting workload of the modified code and other codes which have dependency relationship with the modified code, and further improves the efficiency of collaborative development.
Furthermore, whether the codes of the local working area are changed or not is monitored through the daemon process, and whether the codes of the local working area are changed or not can be monitored more conveniently, efficiently and timely.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 illustrates a flow diagram of a conventional collaborative development approach of the present solution;
FIG. 2 illustrates a collision center diagram in a code collision detection method according to an aspect of the subject application;
FIG. 3 illustrates a flow diagram of a method of code conflict detection in accordance with an aspect of the subject application;
FIG. 4 illustrates a block diagram of a code collision detection device in accordance with an aspect of the subject application.
The same or similar reference numbers in the drawings identify the same or similar elements.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
First, the local work area, local branch and remote warehouse which need to be involved in the application are briefly introduced:
the local working area is mainly used for storing the codes which are being developed by developers and are not submitted to the local branch;
the local branch is mainly used for storing codes which are developed and completed by developers in the local working area and are not submitted to the remote warehouse;
the remote warehouse is mainly used for storing codes submitted by all developers, and the submitted codes are also the latest versions of the merged codes submitted by all developers;
the local working area and the local branch are both in a local development platform, and the remote warehouse is a remote server for storing the latest codes submitted by all developers;
the basic workflow between the local workspace, local branch and remote warehouse is: developers develop codes in the local working area, and submit the codes to the local branch after the development of the codes is completed, so that all developers can obtain the codes developed and completed by each developer in real time, and finally submit the codes submitted to the local branch to the remote warehouse for storage after the codes are submitted to the local branch.
According to an aspect of the present application, a code conflict detection method is provided, which is applied to a server where a remote repository is located, and a server side where the remote repository is located may actively monitor code conflicts in advance, so as to ensure that the code conflicts are discovered in time, where the method includes step S1 and step S2.
And step S1, monitoring whether the code of the local working area is changed, and generating a corresponding change conflict record when the code of the local working area is monitored to be changed, wherein the conflict record comprises the changed code and other codes which have a dependency relationship with the changed code.
In an embodiment of the present application, whether codes in the local work area are modified is monitored through step S1, as shown in fig. 3, a daemon process is established and started for development branches with a large number of developers in a technical team in the collaborative development process, on one hand, a change conflict list is maintained in the daemon process, the change conflict list includes modified codes in the local work area and other codes having a dependency relationship with the modified codes, and on the other hand, the change conflict center dynamically maintains a specific dependency relationship between source codes corresponding to development branches, so that potential conflict codes are detected and identified through the daemon process according to the specific dependency relationship between the change conflict list and the source codes corresponding to the development branches, and a corresponding change conflict list is generated.
In an embodiment of the present application, the daemon process may be deployed at a server side where a remote warehouse is located.
Next, in step S1, the daemon process monitors whether the code in the local work area is changed, and periodically requests the local work area of each developer to obtain a code change at a period T through a heartbeat mechanism, so that when the local work area returns corresponding request feedback information based on the request, as shown in fig. 2, the request feedback information is expressed in the change conflict center in the form of a change conflict record; the change conflict record may be embodied as a change conflict list and a corresponding source code nested call dependency relationship, that is, the changed code and other codes having a dependency relationship with the changed code are recorded in the change conflict list, and the source code nested call dependency relationship may record specific contents of the dependency relationship.
Next, in the above-mentioned embodiment of the present application, when it is monitored by the daemon process in step S1 that no code in the local working area is changed, the request feedback information is response information that no code is changed; when it is monitored that a code in the local working area is changed, the request feedback information may include a changed code, the daemon process generates a corresponding change conflict record in the change conflict center, and the change conflict record includes the changed code and other codes having a dependency relationship with the changed code.
For example, if the modified code is a function a and the other code having a dependency relationship with the modified code is a function B, when it is detected that the code of the local branch related to the function a is modified, the modified code (function a) and the other code (function B) having a dependency relationship with the modified code (function a) may exist in a modification conflict center; for another example, if the modified code is the function C and the other code having a dependency relationship with the modified code is the function D, after the code of the local branch related to the function C is monitored to be modified, the modified code (function C) and the other code (function D) having a dependency relationship with the modified code (function C) may exist in the modification conflict center. Since the function A and the function C are modified, other functions B having a dependency relationship with the function A and other functions D having a dependency relationship with the function C are potential conflict codes, and therefore the calling dependency relationship is nested based on the source codes, the potential conflict codes are identified, and a corresponding change conflict list is generated.
In step S1 of the above embodiment of the present application, after the daemon process monitors whether the code in the local work area is changed to generate a corresponding change conflict record, in step S2, the changed code and other codes that have a dependency relationship with the changed code are merged and compiled to obtain a compilation result, whether the compilation result conflicts or not is determined, and if so, a conflict notification is sent to the work area where the changed code is located.
In an embodiment of the present application, after the change conflict record of the change conflict center is determined in the step S1, the step S2 merges and compiles the modified code and the other codes having a dependency relationship with the modified code according to the change conflict record of the change conflict center to obtain a compiled result, and as shown in fig. 3, after the modified code (function a) and the other codes (function B) having a dependency relationship with the function a in the working areas of the developer P and the developer M are taken, the modified code (function a) and the other codes (function B) having a dependency relationship with the modified code are subjected to parallelization (pre-submission) and compilation (code compilation) by a daemon process to obtain a compiled result.
In an embodiment of the present application, in the step S2, after the compiling result is obtained, the step S2 further determines whether the compiling result conflicts, and if the compiling result conflicts, a conflict notification is sent to a work area where the modified code (function a) is located through the daemon process, so that a developer P in the work area where the function a is located can modify and adjust the corresponding function a and the code corresponding to the function B having a dependency relationship with the function a based on the conflict notification; otherwise, if the compiling result is conflict-free, the change conflict record is deleted, that is, the changed code (function a) and other codes (function B) having a dependency relationship with the changed code (function a) are deleted from the change conflict center, so as to update the change conflict center.
According to the embodiment of the application, whether the code of the local working area is changed or not is monitored, so that the potential problem of code change conflict can be found as early as possible, the conflict notification reminding can be timely carried out on related developers, the time for the developers to modify the changed code and other codes with the dependency relationship with the changed code can be effectively saved, the code rewriting workload of the changed code and other codes with the dependency relationship with the changed code is reduced, and the collaborative development efficiency is improved; it can be understood that whether the codes of the local working area are changed or not can be monitored through the daemon process, and whether the codes of the local working area are changed or not can be monitored more conveniently, efficiently and timely.
In an embodiment of the application, when it is determined that the compiling result conflicts, the step S2 of sending a conflict notification to the work area where the modified code is located specifically may be: and sending conflict notifications of different levels to the working area where the changed code is located according to the submission stage where the changed code is located.
In an embodiment of the present application, if the modified code (function a) is modified in the local working area and submitted in the local working area, a low-level conflict notification is sent to the local working area where the function a is located to remind the developer P of the local working area where the function a is located, so that the developer P can timely know that the function a being modified may affect the function B having a dependency relationship with the function a, and thus the developer P can timely perform collaborative development with the developer M in charge of the working area where the function B is located to achieve consistency, thereby implementing collaborative development of the function a and the function B in the local working area, and avoiding conflict when the function a and the function B are compiled in a combined manner.
In an embodiment of the present application, if the modified code (function a) is modified in the local working area and submitted in the local branch, a high-level conflict notification is sent to the working area where the function a is located to remind the developer P in the local working area where the function a is located, so that the developer P knows that the function a being modified can affect the function B having a dependency relationship with the function a, and even rewrite the function B, and thus the developer P can quickly achieve a consistent collaborative development with the developer M in charge of the working area where the function B is located, and before submitting the modified code (warehouse function a) to a remote location, the conflict is resolved to reflect the urgency of the conflict, so as to avoid causing more complicated code rewriting.
In an embodiment of the present application, when it is determined that the compiling result has a conflict, the step S2, while sending a conflict notification to the work area where the modified code is located, further includes: and sending a conflict notice to the working area where other codes which have the dependency relationship with the changed codes are located.
In an embodiment of the present application, if the modified code (function a) is modified and submitted in the local working area, a conflict notification is sent to the local working area where the function a is located, while the conflict notification is sent to the local working area where the function a is located, a conflict notification is also sent to a working area where another code (function B) dependent on the function a is located, so that a developer M in the working area of the function B confirms that the function a has been modified as soon as possible with the developer P based on the conflict notification, and achieves a collaborative development agreement with each other, so as to avoid affecting the rework of another code (function B) dependent on the function a that the developer M is developing, thereby not only effectively saving the time for the developer P and the developer M to modify the modified code and the other code dependent on the modified code, but also reducing the time for the modified code and the code dependent on the modified code The workload is rewritten, and the collaborative development efficiency is improved.
In an embodiment of the present application, when determining that the compiling result conflicts, the step S2 specifically includes sending a conflict notification to a work area where another code that has a dependency relationship with the modified code is located: according to the submission stage of the modified code, sending conflict notifications of different levels to the working areas where other codes having a dependency relationship with the modified code are located, which is described in the following with specific embodiments:
in an embodiment of the present application, if another code (function B) with a dependency relationship after the change (function a) is modified in the local working area and submitted in the local working area, a low-level conflict notification is sent to the local working area where the function B is located to remind a developer M in the local working area where the function B is located, so that the developer M can timely know that the function B being modified may affect the function a with a dependency relationship, and thus the developer M can timely perform collaborative development with a developer P in charge of the working area where the function a is located to reach a consistency, thereby implementing collaborative development of the function a and the function B in the local working area, and avoiding conflict when the function a and the function B are merged and compiled; if other codes (function B) having a dependency relationship with the modified codes (function A) are modified in the local working area and submitted in the local branch, a high-level conflict notification is sent to the local working area where the function B is located to remind a developer M of the local working area where the function B is located, so that the developer M knows that the function B which is being modified can affect the function A having the dependency relationship with the function B and even cause rewriting of the function A, and thus the developer M can perform coordinated development with a developer P of the working area where the function A is located to be consistent before submitting the function B to a remote warehouse, and thus the developer M can perform corresponding code adjustment on the function B based on the high-level conflict notification and the modification of the function A, or the developer M rewrites the codes of the function B based on the modification of the function A, so as to avoid that a party in collaborative development expends a large cost after submitting the codes corresponding to the function B to the remote warehouse Effort is made to repair the code or to rewrite parts of the code.
In an embodiment of the application, when it is determined that the compiling result has a conflict, the step S2, after sending a conflict notification to the work area where the modified code is located, further includes: receiving feedback of conflict resolution based on the conflict notification from a workspace in which the changed code is located; and deleting the corresponding change conflict record according to the feedback of the conflict resolution.
In an embodiment of the present application, after receiving the conflict notification, the developer P in the working area where the function a is located resolves the conflict accordingly, and sends a feedback of conflict resolution to the daemon process of the remote warehouse based on the conflict resolution, and deletes the change conflict record corresponding to the function a from the change conflict center based on the feedback of conflict resolution, so as to update the change conflict center, thereby avoiding that the resolved conflict repeatedly performs unnecessary conflict judgment and repeatedly makes a corresponding conflict notification.
In an embodiment of the application, when it is determined that the compiling result conflicts, after sending a conflict notification to the work area where the modified code is located in the step S2, the method further includes: and checking whether the change conflict record exists at preset time intervals, and if so, sending a conflict notice to the working area where the changed code is located again.
In an embodiment of the present application, after sending a conflict notification to a working area where the modified code (function a) is located through the daemon, in order to continuously monitor whether the working area where the function a is located is modified correspondingly based on the received conflict notification, it is checked whether a change conflict record corresponding to the conflict notification still has a change conflict center every preset time Δ T, if so, it indicates that the conflict notification sent correspondingly by the change conflict record is not modified and adjusted in the working area where the function a is located by taking corresponding measures, at this time, the conflict notification needs to be sent again to the working area where the modified code (function a) is located, and a developer P in the working area where the function a is located performs corresponding modification on the corresponding function a based on the retransmitted conflict notification, in this embodiment, whether the change conflict record exists is continuously monitored within a preset interval time period, if the conflict exists, the conflict between the corresponding codes is not processed, a conflict notification is sent out in time, and the conflict record is changed and deleted until the conflict processing between the corresponding codes is completed, so that the problem that the conflict between the corresponding codes of the sent conflict notification is not solved in time is solved, and the conflict between each code is effectively processed.
In an embodiment of the present application, when it is determined that the compiling result has a conflict, the step S2 sending a conflict notification to the working area where the modified code is located again specifically includes: and sending conflict notifications of different levels to the working area where the changed code is located again according to the submission stage where the changed code is located. The following description is given by way of specific examples:
in an embodiment of the present application, after it is determined that the compiling result has a conflict, and the working area where the modified code (function a) is located does not make a corresponding code modification based on the conflict notification, a daemon process sends a conflict notification to the working area where the modified code (function a) is located again according to the submission stage where the modified code (function a) is located, so as to remind a developer P in the working area where the function a is located of processing the conflict between corresponding codes until the conflict between corresponding codes is resolved, thereby achieving a purpose of resolving the corresponding code conflict in the local working area, wherein,
if the function A is modified and submitted in the local working area, sending a low-level conflict notification to the local working area where the function A is located to remind a developer P of the working area where the function A is located to achieve the consistency with a developer M of a working area where the function B with a dependency relationship with the function A is located in a timely coordinated development manner, and solving the conflict between the function A and the function B;
if the function A is modified in the local working area and submitted in the local branch, a high-level conflict notification is sent to the local working area where the function A is located, so as to remind a developer P in the working area where the function A is located of solving the conflict between the function A and the function B before the function A is submitted to a remote warehouse, so that the urgency of the conflict is reflected, and more code rewriting is avoided.
In an embodiment of the application, when the step S2 determines that the compiling result has a conflict, the method further includes, while sending a conflict notification to the work area where the modified code is located at the present time: and sending the conflict notice again to the working areas where other codes with the dependency relationship with the changed codes are located. The following description is given by way of specific examples:
in an embodiment of the present application, after it is determined that the compiling result has a conflict, and the working area where the modified code (function a) is located does not modify the code based on the conflict notification, the conflict notification is sent again to the working area where the modified code (function a) is located, and at the same time, the conflict notification is sent again to the working area where the other code (function B) having a dependency relationship with the modified code (function a) is located, so as to remind the developer M in the working area where the function B is located to confirm that the function a has been modified with the developer P as soon as possible based on the conflict notification, and achieve collaborative development consistency with the developer P, so as to avoid affecting rework of the other code (function B) having a dependency relationship with the function a and being developed by the developer M, and thus it is possible to effectively save the time when the developer P and the developer M modify the modified code and the other code having a dependency relationship with the modified code And meanwhile, the code rewriting workload of the modified code and other codes which have dependency relationship with the modified code is reduced, and the collaborative development efficiency is further improved.
In an embodiment of the present application, when it is determined that the compiling result conflicts, the sending of the conflict notification to the work area where the other code that has a dependency relationship with the modified code is located in the step S2 may specifically be: and sending conflict notifications of different levels to the working areas where other codes with the dependency relationship with the changed codes are located again according to the submission stage of the changed codes. The following description is given by way of specific examples:
in an embodiment of the present application, after the compiling result has a conflict, and the working area where the modified code (function a) is located does not make a corresponding code modification based on the conflict notification, the conflict notification is sent again to the working area where the modified code (function a) is located, and at the same time, a conflict notification is sent again to the developer M in the working area where the function B that is dependent on the function a is located according to the stage where the modified code is located, so that the developer M and the developer P cooperate and agree as soon as possible, corresponding modifications to the function a and the function B are implemented, a purpose of solving the code conflict between the function a and the function B is achieved, it is ensured that each code conflict can be processed timely and effectively, and it is avoided that the developer P or the developer M in the process of collaborative development spends a great effort to repair the code after the function B is submitted to a remote repository, or to rewrite part of the code.
According to another aspect of the present application, there is provided a code conflict detection apparatus, which is applied to a server where a remote repository is located, and a server side where the remote repository is located may actively monitor a code conflict in advance, and ensure that the code conflict is timely discovered, as shown in fig. 4, the apparatus includes: a monitoring device 1 and a merging and compiling device 2, wherein,
the monitoring device 1 is configured to: monitoring whether a code of a local working area is changed or not, and generating a corresponding change conflict record when the code of the local working area is monitored to be changed, wherein the conflict record comprises the changed code and other codes which have a dependency relationship with the changed code;
in an embodiment of the present application, before monitoring whether a code in a local working area is modified by using the monitoring device 1, as shown in fig. 3, a daemon process is established for development branches with a large number of developers in a technical team in a collaborative development process and is started, on one hand, a change conflict list is maintained in the daemon process, the change conflict list includes a modified code in the local working area and other codes having a dependency relationship with the modified code, and on the other hand, the change conflict center dynamically maintains a specific dependency relationship between source codes corresponding to development branches, so that a potential conflict code is detected and identified by the daemon process according to the specific dependency relationship between the change conflict list and the source codes corresponding to the corresponding development branches, and a corresponding change conflict list is generated.
In an embodiment of the present application, the daemon process may be deployed at a server side where a remote warehouse is located.
Next, in an embodiment of the present application, whether a code in a local work area is changed is monitored by the monitor 1 through the daemon process, the daemon process periodically requests, through a heartbeat mechanism, a local work area of each developer to obtain a code change at a period T, so that the local work area returns corresponding request feedback information based on the request, and the request feedback information is represented in a change conflict record form in the change conflict center as shown in fig. 2; the change conflict record may be embodied as a change conflict list and a corresponding source code nested call dependency relationship, that is, the changed code and other codes having a dependency relationship with the changed code are recorded in the change conflict list, and the source code nested call dependency relationship may record specific contents of the dependency relationship.
Next, in an embodiment of the present application, when the monitoring device 1 monitors that the code in the local working area is not changed through the daemon process, the request feedback information is response information that the code is not changed; when it is monitored that a code in the local working area is changed, the request feedback information may include a changed code, the daemon process generates a corresponding change conflict record in the change conflict center, and the change conflict record includes the changed code and other codes having a dependency relationship with the changed code. . For example, if the modified code is a function a and the other code having a dependency relationship with the modified code is a function B, when it is detected that the code of the local branch related to the function a is modified, the modified code (function a) and the other code (function B) having a dependency relationship with the modified code (function a) will exist in the modification conflict center; for another example, if the modified code is the function C and the other code having a dependency relationship with the modified code is the function D, after the code of the local branch related to the function C is monitored to be modified, the modified code (function C) and the other code (function D) having a dependency relationship with the modified code (function C) may exist in the modification conflict center. Since the function A and the function C are modified, other functions B having a dependency relationship with the function A and other functions D having a dependency relationship with the function C are potential conflict codes, and therefore the calling dependency relationship is nested based on the source codes, the potential conflict codes are identified, and a corresponding change conflict list is generated.
In the monitoring apparatus 1 in the above embodiment of the present application, after the daemon process monitors whether the code of the local working area is changed to generate a corresponding change conflict record, the merge compiling apparatus 2 is configured to: merging and compiling the modified code and other codes which have a dependency relationship with the modified code to obtain a compiling result, judging whether the compiling result has conflict, and if so, sending a conflict notice to a working area where the modified code is located.
In an embodiment of the present application, after determining the change conflict record of the change conflict center in the monitoring apparatus 1, the merging and compiling apparatus 2 merges and compiles the modified code and the other codes having a dependency relationship with the modified code according to the change conflict record of the change conflict center to obtain a compiled result, and as shown in fig. 3, after taking the modified code (function a) and the other codes (function B) having a dependency relationship with the function a in the working areas of the developer P and the developer M, the modified code (function a) and the other codes (function B) having a dependency relationship with the modified code are subjected to parallelization (pre-submission) and compilation (code compilation) by a daemon process to obtain a compiled result.
After the compiling result is obtained in the merging and compiling device 2, the merging and compiling device 2 further determines whether the compiling result conflicts, on one hand, if the compiling result conflicts, a conflict notification is sent to a working area where the modified code (function a) is located through the daemon process, so that a developer P in the working area where the function a is located can modify and adjust the corresponding code of the function a and the code corresponding to the function B having a dependency relationship with the function a based on the conflict notification; on the other hand, if the compiling result is conflict-free, the change conflict record is deleted, that is, the changed code (function a) and the other code (function B) having a dependency relationship with the changed code (function a) are deleted from the change conflict center, so as to update the change conflict center.
Then, by monitoring whether the code of the local working area is changed or not, the embodiment of the application not only can discover the problem of potential code change conflict as early as possible and prompt relevant developers for conflict notification in time, but also can effectively save the time for developers to modify the changed code and other codes having a dependency relationship with the changed code, reduce the code rewriting workload of the changed code and other codes having a dependency relationship with the changed code, and further improve the collaborative development efficiency; in addition, whether the codes of the local working area are changed or not is monitored through the daemon process, and whether the codes of the local working area are changed or not is monitored more conveniently, efficiently and timely.
Following the above embodiment, the merging and compiling device 2 is specifically configured to: and sending conflict notifications of different levels to the working area where the changed code is located according to the submission stage where the changed code is located. The following description is given by way of specific examples:
if the modified code (function A) is modified and submitted in the local working area, a low-level conflict notification is sent to the local working area where the function A is located to remind a developer P of the local working area where the function A is located, so that the developer P can timely know that the function A which is being modified possibly affects a function B which has a dependency relationship with the function A, and the developer P can timely achieve the same collaborative development with a responsible developer M of the working area where the function B is located, thereby realizing the collaborative development of the function A and the function B in the local working area and avoiding the conflict generated when the function A and the function B are combined and compiled;
if the modified code (function A) is modified in the local working area and submitted in the local branch, a high-level conflict notification is sent to the working area where the function A is located to remind a developer P of the local working area where the function A is located, so that the developer P knows that the function A which is being modified can affect the function B which has a dependency relationship with the function A, and even rewrite of the function B, and thus the developer P can quickly achieve the same collaborative development with a developer M in charge of the working area where the function B is located.
Next to the above embodiment, when the monitoring device 1 determines that the compiling result conflicts, and sends a conflict notification to the work area where the modified code is located, the merging and compiling device 2 is further configured to: and sending a conflict notice to the working area where other codes which have the dependency relationship with the changed codes are located. The following description is given by way of specific examples:
in an embodiment of the present application, if the modified code (function a) is modified in the local working area and submitted in the local working area, a conflict notification is sent to the local working area where the function a is located, while the conflict notification is sent to the local working area where the function a is located, a conflict notification is also sent to a working area where other codes (function B) dependent on the function a are located, and a developer M in the working area of the function B confirms that the function a has been modified and achieves mutual collaborative development agreement with the developer P as soon as possible based on the conflict notification, so as to avoid affecting the rework of other codes (function B) dependent on the function a that the developer M is developing, thereby not only effectively saving the time for the developer P and the developer M to modify the modified code and other codes dependent on the modified code, and the code rewriting workload of the modified code and other codes which have dependency relationship with the modified code is reduced, so that the collaborative development efficiency is improved. In addition, whether the codes of the local working area are changed or not is monitored through the daemon process, and whether the codes of the local working area are changed or not can be monitored conveniently, efficiently and timely.
In an embodiment of the present application, the merging and compiling device 2 is specifically configured to: and sending conflict notifications of different levels to the working areas where other codes with the dependency relationship with the changed codes are located according to the submission stage of the changed codes. The following description is given by way of specific examples:
in an embodiment of the present application, if another code (function B) with a dependency relationship after the change (function a) is modified in the local working area and submitted in the local working area, a low-level conflict notification is sent to the local working area where the function B is located to remind a developer M in the local working area where the function B is located, so that the developer M can timely know that the function B being modified may affect the function a with a dependency relationship, and thus the developer M can timely perform collaborative development with a developer P in charge of the working area where the function a is located to reach a consistency, thereby implementing collaborative development of the function a and the function B in the local working area, and avoiding conflict when the function a and the function B are merged and compiled;
if other codes (function B) having a dependency relationship with the modified codes (function A) are modified in the local working area and submitted in the local branch, a high-level conflict notification is sent to the local working area where the function B is located to remind a developer M of the local working area where the function B is located, so that the developer M knows that the function B which is being modified can affect the function A having the dependency relationship with the function B and even cause rewriting of the function A, and thus the developer M can perform coordinated development with a developer P of the working area where the function A is located to be consistent before submitting the function B to a remote warehouse, and thus the developer M can perform corresponding code adjustment on the function B based on the high-level conflict notification and the modification of the function A, or the developer M rewrites the codes of the function B based on the modification of the function A, so as to avoid that a party in collaborative development expends a large cost after submitting the codes corresponding to the function B to the remote warehouse Effort is made to repair the code or to rewrite parts of the code.
In an embodiment of the present application, the merging and compiling device 2 is further configured to: receiving feedback of conflict resolution based on the conflict notification from a workspace in which the changed code is located; and deleting the corresponding change conflict record according to the feedback of the conflict resolution.
In an embodiment of the present application, after receiving the conflict notification, the developer P in the working area where the function a is located resolves the conflict accordingly, sends a feedback of conflict resolution to the daemon process of the remote warehouse based on the conflict resolution, and deletes the change conflict record corresponding to the function a from the change conflict center based on the feedback of conflict resolution to update the change conflict center, so as to avoid that the resolved conflict repeatedly performs unnecessary conflict judgment and repeatedly makes a corresponding conflict notification.
In an embodiment of the present application, the merging and compiling device 2 is further configured to: and checking whether the change conflict record exists at preset time intervals, and if so, sending a conflict notice to the working area where the changed code is located again.
In an embodiment of the present application, after sending a conflict notification to a working area where the modified code (function a) is located through the daemon, in order to continuously monitor whether the working area where the function a is located is modified correspondingly based on the received conflict notification, it is checked whether a change conflict record corresponding to the conflict notification still has a change conflict center every preset time Δ T, if so, it indicates that the conflict notification sent correspondingly by the change conflict record is not modified and adjusted in the working area where the function a is located by taking corresponding measures, at this time, the conflict notification needs to be sent again to the working area where the modified code (function a) is located, and a developer P in the working area where the function a is located modifies the corresponding function a correspondingly based on the retransmitted conflict notification, which is implemented by continuously monitoring whether a change conflict record exists within a preset interval time period, if the conflict exists, the conflict between the corresponding codes is not processed, a conflict notification is sent out in time, and the conflict record is changed and deleted until the conflict processing between the corresponding codes is completed, so that the problem that the conflict between the corresponding codes of the sent conflict notification is not solved in time is solved, and the conflict between each code is effectively processed.
In an embodiment of the present application, the merging and compiling device 2 is configured to: and sending conflict notifications of different levels to the working area where the changed code is located again according to the submission stage where the changed code is located. The following description is given by way of specific examples:
in an embodiment of the present application, after it is determined that the compiling result has a conflict, and the working area where the modified code (function a) is located does not make a corresponding code modification based on the conflict notification, a daemon process sends a conflict notification to the working area where the modified code (function a) is located again according to the submission stage where the modified code (function a) is located, so as to remind a developer P in the working area where the function a is located of processing the conflict between corresponding codes until the conflict between corresponding codes is resolved, thereby achieving a purpose of resolving the corresponding code conflict in the local working area, wherein,
if the function A is modified and submitted in the local working area, sending a low-level conflict notification to the local working area where the function A is located to remind a developer P of the working area where the function A is located to achieve the consistency with a developer M of a working area where the function B with a dependency relationship with the function A is located in a timely coordinated development manner, and solving the conflict between the function A and the function B;
if the function A is modified in the local working area and submitted in the local branch, a high-level conflict notification is sent to the local working area where the function A is located, so as to remind a developer P in the working area where the function A is located of solving the conflict between the function A and the function B before the function A is submitted to a remote warehouse, so that the urgency of the conflict is reflected, and more code rewriting is avoided.
In an embodiment of the present application, the merging and compiling device 2 is further configured to: and sending the conflict notice again to the working areas where other codes with the dependency relationship with the changed codes are located. The following description is given by way of specific examples:
in an embodiment of the present application, after it is determined that the compilation result has a conflict, and the working area where the modified code (function a) is located does not modify the code based on the conflict notification, the conflict notification is sent again to the working area where the modified code (function a) is located, and at the same time, the conflict notification is sent again to the working area where the other code (function B) having a dependency relationship with the modified code (function a) is located, so as to remind the developer M in the working area where the function B is located to confirm that the function a has been modified with the developer P as soon as possible based on the conflict notification, and achieve collaborative development with the developer P, so as to avoid affecting the rework of the other code (function B) having a dependency relationship with the function a and being developed by the developer M, and effectively save the developer P and the developer M from modifying the modified code and the other code having a dependency relationship with the modified code The time of the code rewriting method reduces the workload of code rewriting the modified code and other codes which have dependency relationship with the modified code, and further improves the efficiency of collaborative development. It can be understood that whether the codes of the local working area are changed or not is monitored through the daemon process, and whether the codes of the local working area are changed or not can be monitored more conveniently, efficiently and timely.
In an embodiment of the present application, the merging and compiling device 2 is specifically configured to: and sending conflict notifications of different levels to the working areas where other codes with the dependency relationship with the changed codes are located again according to the submission stage of the changed codes. The following description is given by way of specific examples:
in an embodiment of the present application, after the compiling result has a conflict, and the working area where the modified code (function a) is located does not make a corresponding code modification based on the conflict notification, the conflict notification is sent again to the working area where the modified code (function a) is located, and at the same time, a conflict notification is sent again to the developer M in the working area where the function B that is dependent on the function a is located according to the stage where the modified code is located, so that the developer M and the developer P cooperate and agree as soon as possible, corresponding modifications to the function a and the function B are implemented, a purpose of solving the code conflict between the function a and the function B is achieved, it is ensured that each code conflict can be processed timely and effectively, and it is avoided that the developer P or the developer M in the process of collaborative development spends a great effort to repair the code after the function B is submitted to a remote repository, or to rewrite part of the code.
In summary, the method and the device for changing the code of the local working area generate a corresponding change conflict record by monitoring whether the code of the local working area is changed or not when the code of the local working area is monitored to be changed, wherein the conflict record comprises the changed code and other codes which have a dependency relationship with the changed code; then, merging and compiling the modified code and other codes which have dependency relationship with the modified code to obtain a compiling result, then judging whether the compiling result has conflict, if so, sending a conflict notice to a working area where the modified code is located, and simultaneously sending a conflict notice to a working area where other codes which have dependency relationship with the modified code are located, so that the working area where the modified code is located and the working area where other codes which have dependency relationship with the modified code are located correspondingly modify and adjust the modified code and other codes which have conflict, thereby not only effectively saving the time of modifying the modified code and other codes which have dependency relationship with the modified code by developers, but also reducing the code rewriting workload of the modified code and other codes which have dependency relationship with the modified code, and further improves the efficiency of collaborative development. The method and the system have the advantages that whether the codes of the local working area are changed or not is monitored through the daemon process, and whether the codes of the local working area are changed or not can be monitored conveniently, efficiently and timely.
In the practical application scenario of the code conflict detection method provided by the present application, when developers needing development branches collaboratively develop a travel application, the developer P is responsible for the login function code of the travel application, the developer M is responsible for the browsing function code of the travel application, and the developer N is responsible for the payment function code of the travel application, wherein,
a browsing function code calls a login function code, a payment function code calls the login function code and the browsing function code, a daemon process monitors that a developer M modifies the browsing function code, receives request feedback information sent by a working area where the developer M is located, records the modified browsing function code, the login function code and the payment function code which are dependent on the browsing function code in a code conflict center, generates a code conflict record, combines and compiles the modified browsing function code, the login function code and the payment function code which are dependent on the browsing function code to obtain a compiling result, and judges whether the compiling result conflicts,
if the conflict exists, a conflict notice is sent to the working area where the login function code and the payment function code of the browsing function code and the rest of the browsing functions which have the dependency relationship are located, so that the developer P, the developer M and the developer N adopt corresponding modification measures for the corresponding login function code, the browsing function code and the payment function code based on the conflict notice, the situation that a party spends great efforts to repair the corresponding codes or rewrite partial codes after the codes are submitted to a remote warehouse is avoided, and the collaborative development efficiency is improved. It can be understood that whether the codes of the local working area are changed or not is monitored through the daemon process, and whether the codes of the local working area are changed or not can be monitored more conveniently, efficiently and timely.
A computing-based device according to the present application, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
monitoring whether a code of a local working area is changed or not, and generating a corresponding change conflict record when the code of the local working area is monitored to be changed, wherein the conflict record comprises the changed code and other codes which have a dependency relationship with the changed code;
merging and compiling the modified code and other codes which have a dependency relationship with the modified code to obtain a compiling result, judging whether the compiling result has conflict, and if so, sending a conflict notice to a working area where the modified code is located.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, for example, implemented using Application Specific Integrated Circuits (ASICs), general purpose computers or any other similar hardware devices. In one embodiment, the software programs of the present application may be executed by a processor to implement the steps or functions described above. Likewise, the software programs (including associated data structures) of the present application may be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Additionally, some of the steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
In addition, some of the present application may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present application through the operation of the computer. Program instructions which invoke the methods of the present application may be stored on a fixed or removable recording medium and/or transmitted via a data stream on a broadcast or other signal-bearing medium and/or stored within a working memory of a computer device operating in accordance with the program instructions. An embodiment according to the present application comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform a method and/or a solution according to the aforementioned embodiments of the present application.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.

Claims (21)

1. A code conflict detection method is applied to a server where a remote warehouse is located, and comprises the following steps:
monitoring whether codes of a local working area are changed or not through a daemon process, and generating a corresponding change conflict record when the codes of the local working area are changed, wherein the conflict record comprises changed codes and other codes which have a dependency relationship with the changed codes, the local working area is used for storing codes which are being developed by developers and are not submitted to a local branch, and the local branch is used for storing codes which are developed in the local working area by the developers and are not submitted to a remote warehouse;
merging and compiling the modified code and other codes which have a dependency relationship with the modified code to obtain a compiling result, judging whether the compiling result has conflict, and if so, sending a conflict notice to a working area where the modified code is located.
2. The method of claim 1, wherein issuing a conflict notification to a workspace where the modified code is located comprises:
and sending conflict notifications of different levels to the working area where the changed code is located according to the submission stage where the changed code is located.
3. The method of claim 1, wherein the sending the conflict notification to the working area where the changed code is located further comprises:
and sending a conflict notice to the working area where other codes which have the dependency relationship with the changed codes are located.
4. The method of claim 3, wherein issuing a conflict notification to a workspace in which other code that is dependent on the changed code is located comprises:
and sending conflict notifications of different levels to the working areas where other codes with the dependency relationship with the changed codes are located according to the submission stage of the changed codes.
5. The method of claim 1, wherein after determining whether the compilation result has a conflict, further comprising:
and if no conflict exists, deleting the change conflict record.
6. The method of claim 1, wherein after issuing a conflict notification to the workspace where the modified code is located, further comprising:
receiving feedback of conflict resolution based on the conflict notification from a workspace in which the changed code is located;
and deleting the corresponding change conflict record according to the feedback of the conflict resolution.
7. The method of claim 6, wherein after issuing a conflict notification to the workspace where the modified code is located, further comprising:
checking whether the change conflict record exists at preset time intervals,
and if so, sending a conflict notice to the working area where the changed code is located again.
8. The method of claim 7, wherein reissuing the conflict notification to the workspace where the modified code resides comprises:
and sending conflict notifications of different levels to the working area where the changed code is located again according to the submission stage where the changed code is located.
9. The method of claim 7, wherein, while sending the conflict notification to the working area where the changed code is located, further comprising:
and sending the conflict notice again to the working areas where other codes with the dependency relationship with the changed codes are located.
10. The method of claim 9, wherein reissuing the conflict notification to the workspace where other code dependent on the changed code is located comprises:
and sending conflict notifications of different levels to the working areas where other codes with the dependency relationship with the changed codes are located again according to the submission stage of the changed codes.
11. A code collision detection apparatus, for use with a server at which a remote repository resides, the apparatus comprising:
the monitoring device is used for monitoring whether codes of a local working area are changed or not through a daemon process, and when the codes of the local working area are monitored to be changed, a corresponding change conflict record is generated, wherein the conflict record comprises changed codes and other codes which have a dependency relationship with the changed codes, the local working area is used for storing codes which are being developed by developers and are not submitted to a local branch, and the local branch is used for storing codes which are developed in the local working area by the developers and are not submitted to a remote warehouse;
and the merging and compiling device is used for merging and compiling the modified code and other codes which have a dependency relationship with the modified code to obtain a compiling result, judging whether the compiling result conflicts, and if so, sending a conflict notice to a working area where the modified code is located.
12. The apparatus of claim 11, wherein the merge compiling means is to:
and sending conflict notifications of different levels to the working area where the changed code is located according to the submission stage where the changed code is located.
13. The apparatus of claim 11, wherein the merge compilation means is further operable to:
and sending a conflict notice to the working area where other codes which have the dependency relationship with the changed codes are located.
14. The apparatus of claim 13, wherein the merge compiling means is for:
and sending conflict notifications of different levels to the working areas where other codes with the dependency relationship with the changed codes are located according to the submission stage of the changed codes.
15. The apparatus of claim 11, wherein the merge compilation means is further operable to:
and if no conflict exists, deleting the change conflict record.
16. The apparatus of claim 11, wherein the merge compilation means is further operable to:
receiving feedback of conflict resolution based on the conflict notification from a workspace in which the changed code is located;
and deleting the corresponding change conflict record according to the feedback of the conflict resolution.
17. The apparatus of claim 16, wherein the merge compilation means is further operable to:
checking whether the change conflict record exists at preset time intervals,
and if so, sending a conflict notice to the working area where the changed code is located again.
18. The apparatus of claim 17, wherein the merge compiling means is for:
and sending conflict notifications of different levels to the working area where the changed code is located again according to the submission stage where the changed code is located.
19. The apparatus of claim 17, wherein the merge compilation means is further operable to:
and sending the conflict notice again to the working areas where other codes with the dependency relationship with the changed codes are located.
20. The apparatus of claim 19, wherein the merge compiling means is for:
and sending conflict notifications of different levels to the working areas where other codes with the dependency relationship with the changed codes are located again according to the submission stage of the changed codes.
21. A computing-based device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
monitoring whether codes of a local working area are changed or not through a daemon process, and generating a corresponding change conflict record when the codes of the local working area are changed, wherein the conflict record comprises changed codes and other codes which have a dependency relationship with the changed codes, the local working area is used for storing codes which are being developed by developers and are not submitted to a local branch, and the local branch is used for storing codes which are developed in the local working area by the developers and are not submitted to a remote warehouse;
merging and compiling the modified code and other codes which have a dependency relationship with the modified code to obtain a compiling result, judging whether the compiling result has conflict, and if so, sending a conflict notice to a working area where the modified code is located.
CN201611001045.6A 2016-11-14 2016-11-14 Code conflict detection method and device Active CN108073501B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611001045.6A CN108073501B (en) 2016-11-14 2016-11-14 Code conflict detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611001045.6A CN108073501B (en) 2016-11-14 2016-11-14 Code conflict detection method and device

Publications (2)

Publication Number Publication Date
CN108073501A CN108073501A (en) 2018-05-25
CN108073501B true CN108073501B (en) 2021-08-13

Family

ID=62162399

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611001045.6A Active CN108073501B (en) 2016-11-14 2016-11-14 Code conflict detection method and device

Country Status (1)

Country Link
CN (1) CN108073501B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111273944B (en) * 2018-12-05 2024-01-30 三六零科技集团有限公司 Method and device for generating program file and uploading program file to code warehouse
CN111176983B (en) 2019-10-18 2021-10-22 华为技术有限公司 Code conflict resolution system, method, device, equipment and medium
CN112860248B (en) * 2019-11-27 2023-12-05 中盈优创资讯科技有限公司 Source code generation method and device
CN111221566B (en) * 2019-12-28 2021-10-22 华为技术有限公司 Method and device for combining multiple and changeable versions of software code
CN111190583B (en) * 2019-12-31 2021-10-22 华为技术有限公司 Associated conflict block presenting method and equipment
CN112363719A (en) * 2020-11-23 2021-02-12 百度在线网络技术(北京)有限公司 Method, device and equipment for combining small program templates and storage medium
CN113377660B (en) * 2021-06-23 2024-05-14 北京百度网讯科技有限公司 Test method and device
CN115543277A (en) * 2021-06-30 2022-12-30 中兴通讯股份有限公司 Code integration verification method and device
CN113900664A (en) * 2021-12-09 2022-01-07 中航金网(北京)电子商务有限公司 Real-time code conflict detection method, detection device, server and storage medium
CN115829189B (en) * 2023-02-08 2023-05-05 安徽深迪科技有限公司 Visual scheduling method and device for big data of intelligent factory
CN116302078B (en) * 2023-05-19 2023-08-01 深圳前海环融联易信息科技服务有限公司 Code file merging method and device, storage medium and computer equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309804A (en) * 2013-04-08 2013-09-18 中国电子科技集团公司第十研究所 Automatic code rule checking platform
CN105183789A (en) * 2015-08-21 2015-12-23 福建天晴数码有限公司 File merging method and system based on git source code confliction

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9659012B2 (en) * 2013-05-17 2017-05-23 Oracle International Corporation Debugging framework for distributed ETL process with multi-language support

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309804A (en) * 2013-04-08 2013-09-18 中国电子科技集团公司第十研究所 Automatic code rule checking platform
CN105183789A (en) * 2015-08-21 2015-12-23 福建天晴数码有限公司 File merging method and system based on git source code confliction

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
svn中出现红色感叹号;niu_hao;《CSDN博客 http://blog.csdn.net/niu_hao/article/details/6774471》;20110914;第1页 *
SVN在VerilogHDL开发过程中的应用;丁晴等;《电子设计工程》;20140331;第22卷(第5期);第2节 *

Also Published As

Publication number Publication date
CN108073501A (en) 2018-05-25

Similar Documents

Publication Publication Date Title
CN108073501B (en) Code conflict detection method and device
US10620933B2 (en) Techniques for efficient application configuration patching
US8762929B2 (en) System and method for exclusion of inconsistent objects from lifecycle management processes
Maximilien et al. Assessing test-driven development at IBM
US8407670B2 (en) Collaborative code conflict detection, notification and resolution
US7769821B2 (en) Systems and methods for enhanced meassage support using a generic client proxy
US9946989B2 (en) Management and notification of object model changes
Demuth et al. Co-evolution of metamodels and models through consistent change propagation
US8689179B2 (en) Transportable refactoring object
Seater et al. Requirement progression in problem frames: deriving specifications from requirements
JP2010231782A (en) Method and system for function automation
WO2004079529A2 (en) System and method for software component dependency checking
TW201337737A (en) Server upgrades with safety checking and preview
US20150269061A1 (en) Method and system for code analysis using symbolic types
Jayaputera et al. Enabling run-time composition and support for heterogeneous pervasive multi-agent systems
EP2199905A1 (en) Lifecycle management and consistency checking of object models using application platform tools
US20110154096A1 (en) Business Methods Retry Optimization
Elamin et al. Towards requirements reuse by implementing traceability in agile development
JP2017520858A (en) Control when starting an atomic task on a server platform
CN110119283B (en) Application update processing method, device and system and application update system
Roa et al. Specification of behavioral anti-patterns for the verification of block-structured collaborative business processes
US7921417B2 (en) Method and computer system for activation of source files
Rosa et al. Lightweight formalisation of adaptive middleware
US11301246B2 (en) Automatically generating continuous integration pipelines
US8918433B2 (en) Identifying and reacting to changes in an extensible automatic runtime object management system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant