CN111796855A - Incremental version updating method and device, storage medium and computer equipment - Google Patents

Incremental version updating method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN111796855A
CN111796855A CN202010712392.XA CN202010712392A CN111796855A CN 111796855 A CN111796855 A CN 111796855A CN 202010712392 A CN202010712392 A CN 202010712392A CN 111796855 A CN111796855 A CN 111796855A
Authority
CN
China
Prior art keywords
source file
source
file
state identifier
branch
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.)
Granted
Application number
CN202010712392.XA
Other languages
Chinese (zh)
Other versions
CN111796855B (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.)
Dazhu Hangzhou Technology Co ltd
Original Assignee
Dazhu Hangzhou Technology Co 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 Dazhu Hangzhou Technology Co ltd filed Critical Dazhu Hangzhou Technology Co ltd
Priority to CN202010712392.XA priority Critical patent/CN111796855B/en
Publication of CN111796855A publication Critical patent/CN111796855A/en
Application granted granted Critical
Publication of CN111796855B publication Critical patent/CN111796855B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an incremental version updating method, an incremental version updating device, a storage medium and computer equipment, relates to the technical field of computers, and mainly aims to automatically branch and merge a version control system in incremental version updating, correspondingly process a source file according to different states of the source file and generate a version updating log. The method comprises the following steps: based on a source branch of a version control system, acquiring a modification log under a preset condition; analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier and path information of a source file; merging the source files under the source branch into a target branch; and correspondingly processing the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating. The invention is suitable for updating the incremental version.

Description

Incremental version updating method and device, storage medium and computer equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for updating an incremental version, a storage medium, and a computer device.
Background
In the process of modifying the codes and the logs cooperatively by the multi-person team, unnecessary conflicts often occur, meanwhile, with the gradual stabilization of the version, a certain part of boards and codes need to be updated in an incremental mode, and for a java project, corresponding class bytecode files and resource files are usually required to be generated. Especially with java code of anonymous inner classes or static classes, one java file may even result in multiple class files, which are inevitably copied with omissions resulting in unexpected errors. The publishing process generally covers the changed class files and resource files with online contents, so as to realize the incremental updating process.
At present, in the existing incremental version updating process, a developer usually copies the modified file to the target path or directory manually. However, this requires developers to be very familiar with the contents of the modified files involved and to be able to accurately correspond to the paths and directories associated with the modified files, the contents of the configuration files involved, etc. Therefore, incremental version updating is inefficient and inevitably introduces human errors, so that a risk point exists in the updating process.
Disclosure of Invention
In view of the above, the present invention provides an incremental version updating method, an incremental version updating device, a storage medium, and a computer device, and mainly aims to solve the problem that in the existing incremental release process, a developer needs to manually copy a source file to a target path or directory, the updating efficiency is low, and human errors are inevitably introduced, which causes risk points in the incremental version updating process.
According to an aspect of the present invention, there is provided an incremental version update method, including:
based on a source branch of a version control system, acquiring a modification log under a preset condition;
analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier and path information of a source file;
merging the source files under the source branch into a target branch;
and correspondingly processing the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating.
Further, the analyzing the modification log to obtain source file information includes:
respectively configuring regular expressions according to the state identification, the modified content information and the path information to be acquired;
and analyzing the modification log by using the regular expression to obtain the state identification, the modification content information and the path information of the source file.
Further, the merging the source files under the source branch into the target branch includes:
defining a version warehouse address, a source file path and a target file path;
and merging the source file from a source branch to a preset target branch according to a preset conflict merging strategy, the version warehouse address, the source file path and the target file path.
Further, the processing the source file according to the state identifier of the source file and the path information to implement incremental version update includes:
identifying a state identifier of the source file;
if the state identifier is a first state identifier, copying the source file to a target file directory according to the path information;
if the state identifier is a second state identifier, deleting a target file corresponding to the source file according to the path information;
and if the state identifier is a third state identifier, replacing the target file corresponding to the source file according to the path information.
Optionally, before performing corresponding processing on the source file under the target branch according to the state identifier and the path information to implement incremental version update, the method further includes:
and compiling the source file to obtain a class file or a resource file which has a mapping relation with the source file.
Further, if the state identifier is the first state identifier, copying the source file to a destination file directory according to the path information, including:
defining a version warehouse address;
adding the source file to a version repository according to the version repository address;
and creating a target file directory according to the path information, and copying the source file to the target file directory.
Optionally, the source file information further includes modified content information, and after the source file is correspondingly processed according to the state identifier and the path information of the source file to implement incremental version update, the method further includes:
and generating a version updating log according to the source file and the modified content information of the source file.
According to two aspects of the present invention, an incremental version updating apparatus is provided, which includes:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a modification log under a preset condition based on a source branch of a version control system;
the analysis unit is used for analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier of a source file, modification content information and path information;
the merging unit is used for merging the source files under the source branch into the target branch;
and the processing unit is used for carrying out corresponding processing on the source file according to the state identifier and the path information of the source file so as to realize incremental version updating.
Further, the parsing unit includes:
the configuration module is used for respectively configuring regular expressions according to the state identification, the modified content information and the path information to be acquired;
and the analysis module is used for analyzing the modification log by using the regular expression to obtain the state identifier, the modification content information and the path information of the source file.
Further, the merging unit includes:
the definition module is used for defining a version warehouse address, a source file path and a target file path;
and the merging module is used for merging the source file from a source branch to a preset target branch according to a preset conflict merging strategy, the version warehouse address, the source file path and the target file path.
Further, the processing unit includes:
the identification module is used for identifying the state identifier of the source file;
the first processing module is used for copying the source file to a target file directory according to the path information if the state identifier is a first state identifier;
the second processing module is used for deleting the target file corresponding to the source file according to the path information if the state identifier is a second state identifier;
and the third processing module is used for replacing the target file corresponding to the source file according to the path information if the state identifier is a third state identifier.
Optionally, the apparatus further comprises:
and the compiling unit is used for compiling the source file to obtain a class file or a resource file which has a mapping relation with the source file.
Further, the first processing module is specifically further configured to define a version repository address; adding the source file to a version repository according to the version repository address; and creating a target file directory according to the path information, and copying the source file to the target file directory.
Optionally, the apparatus further comprises:
and the generating unit is used for generating a version updating log according to the source file and the modified content information of the source file.
According to a third aspect of the present invention, there is provided a storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform the steps of: based on a source branch of a version control system, acquiring a modification log under a preset condition; analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier and path information of a source file; merging the source files under the source branch into a target branch; and correspondingly processing the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating.
According to a fourth aspect of the present invention, there is provided a computer device comprising a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus, and the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to perform the following steps: based on a source branch of a version control system, acquiring a modification log under a preset condition; analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier and path information of a source file; merging the source files under the source branch into a target branch; and correspondingly processing the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating.
Compared with the prior art that a developer copies a file to be published to a target path or a directory manually, the incremental version updating method, the incremental version updating device, the storage medium and the computer equipment acquire a modification log under a preset condition through a source branch based on a version control system; analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier and path information of a source file; merging the source files under the source branch into a target branch; and correspondingly processing the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating. Therefore, conflict combination and processing of the source files can be automatically realized through the preset python script, the updating efficiency and accuracy are improved, and risks in the updating process are reduced.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flowchart illustrating an incremental version update method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another incremental version update method provided by an embodiment of the invention;
fig. 3 is a schematic structural diagram illustrating an incremental version updating apparatus according to an embodiment of the present invention;
fig. 4 shows a physical structure diagram of a computer device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As described in the background, currently, the incremental version update process is usually implemented by a developer manually copying the modified file to the target path or directory. However, this requires developers to be very familiar with the contents of the modified files involved and to be able to accurately correspond to the paths and directories associated with the modified files, the contents of the configuration files involved, etc. Therefore, incremental version updating is inefficient and inevitably introduces human errors, so that a risk point exists in the updating process.
In order to solve the above problem, an embodiment of the present invention provides an incremental version updating method, as shown in fig. 1, where the method includes:
101. and acquiring a modification log under a preset condition based on a source branch of the version control system.
The source branch may specifically include a UAT branch, and the code file to be issued and the modification log are included below the source branch. In an actual application scenario, the UAT environment is generally a pre-release environment, and the files under the UAT branch are files to be released, that is, branches where code files meeting release requirements after being tested by developers submit the code files. The modification log may be a list of file modifications submitted by developers concurrently with submitting code files.
For the embodiment of the invention, incremental version updating is carried out based on the version control system, so that a modification log submitted by a developer can be obtained through a svn log instruction of the version control system. Meanwhile, a modification log under a specified condition can be obtained by modifying a parameter of the svn log instruction. The specified conditions may specifically include: 1) a modification log submitted by a designated developer, such as a modification log only submitted by a developer A; 2) the modification logs submitted in a specified time range, such as the modification logs submitted only from 1/6/2020 to 2/6/2020; 3) a modification log of a specified state, such as a modification log that only acquires a state of deletion. It should be noted that, in an actual application scenario, modified content needs to be recorded in the incremental version updating process, and it is difficult to copy and integrate the modification log submitted by a developer based on a version control system.
102. And analyzing the modification log to obtain source file information.
The source file information comprises state identification, modified content information and path information of the source file. The state identifier may specifically include three states of modification, addition, and deletion. It should be noted that, in an actual application scenario, the status identifier of the source file may also include an update, but since it does not involve any modification, it is not specifically described in the embodiment of the present invention. Specifically, the modification log under the source branch may be analyzed to obtain source file information under the source branch, including state identifier, modified content information, path information, and the like. So as to realize the incremental update of the version according to the source file information subsequently.
103. And merging the source files under the source branch into the target branch.
The merging of the source files under the source branch into the target branch may include: and merging the source branch to the target branch according to the conflict merging strategy. Specifically, the svn update-accept tc policy may be adopted to perform update policy processing before branch merging, and meanwhile, a situation that a source branch cannot be compared due to version update under the condition that some local file directories or files do not exist is considered, so that an svn merge-accept tc command operation needs to be executed on a directory before update traced from the current branch. Specifically, the conflict merge processing may be performed on the file under the source branch through a conflict merge policy, so that the file under the source branch is merged into the file under the target branch, so as to perform uniform issuing processing on the source file under the target branch subsequently.
104. And correspondingly processing the source file according to the state identifier and the path information of the source file so as to realize incremental version updating.
Specifically, according to the state identifier of the source file, different processing strategies may be adopted for the source file, for example, if the state identifier of the source file is deletion, the source file may be deleted; if the state identifier of the source file is modified, the source file can be used for replacement. The path information may be used for searching a target position of the source file, and the target position of the file to be deleted, added or modified may be searched according to the path information, so as to delete, add or modify the source file. According to the state identification and the path information of the source file, different processing strategies can be adopted for the source file, so that incremental version updating can be conveniently realized.
An embodiment of the present invention provides another incremental version updating method, as shown in fig. 2, the method includes:
201. and analyzing the modification log to obtain source file information.
This step is the same as step 102 shown in fig. 1, and is not described herein again.
For the embodiment of the present invention, the step 201 may specifically include: respectively configuring regular expressions according to the state identification to be captured, the modified content information and the path information; and analyzing the modification log by using the regular expression to obtain the state identification, the modification content information and the path information of the source file.
The regular expression may describe and capture a character string conforming to a certain characteristic through a single character string, and the regular expression may include the target fields of the state identifier to be captured, the modified content information, the path information, and the like. It should be noted that the regular expressions may be user-defined regular expressions according to actual conditions, the number of the regular expressions may be determined according to the state identifier to be captured, the modified content information, and the path information, and in an actual application scenario, the regular expressions are usually respectively corresponding to one preconfigured regular expression. Specifically, a modification log may be obtained, and a source file state identifier, modified content information, and path information are captured from the modification log according to a preconfigured regular expression, so as to perform incremental version update on a source file according to the state identifier, the modified content information, and the path information.
202. And merging the source files under the source branch into the target branch.
This step is the same as step 103 shown in fig. 1, and is not described herein again.
For the embodiment of the present invention, the step 202 may specifically include: defining a version warehouse address; and merging the source file from a source branch to a preset target branch according to a preset conflict merging strategy and the version warehouse address.
The version warehouse is a core part of the version control system and is a central warehouse of data. The version repository holds information in the form of a file system tree in a typical file and directory structure. Any number of clients connect to the version repository to read and modify these files. The client shares information to other people through writing data, and obtains the information shared by other people through reading data. It should be noted that, for the version control system, the new source file in the state of being added to the version repository is required to be added, so that the information recording of the file by the version control system can be realized. The version repository address may be a path corresponding to the user according to the created version repository. The preset conflict merge policy may specifically be a merge policy that is taken when the source file is merged from a source branch to a target branch, and may specifically be set by a user according to a specific requirement. For the embodiment of the invention, an svn update-accept tc strategy can be adopted, and the file modification state is analyzed to perform different operations, for example, when the state is newly added, the source file is firstly added to a version warehouse, then path conversion is executed, and the source file is copied to a target file directory; and when the state is deletion, marking the source file, and deleting the target file in the target file directory according to the path information.
The embodiment of the invention can realize the combination of the source files under different branches by combining the source files under the source branch to the target branch and by a preset conflict combination strategy, so as to be convenient for carrying out corresponding processing on the source files and improve the efficiency of issuing the incremental version.
203. And correspondingly processing the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating.
This step is the same as step 104 shown in fig. 1, and will not be described herein again.
For the embodiment of the present invention, the step 203 may specifically include: identifying a state identifier of the source file; if the state identifier is a first state identifier, copying the source file to a target file directory according to the path information; if the state identifier is a second state identifier, deleting a target file corresponding to the source file according to the path information; and if the state identifier is a third state identifier, replacing the target file corresponding to the source file according to the path information.
The state identifier of the source file may be implemented by setting a state as a, for example, a new state is represented by a, a modification state is represented by M, and a deletion state is represented by D, which may be specifically defined by a user. The first status flag may include an added status, the second status flag may include a deleted status, and the third status flag may include a modified status. Specifically, a state identifier of each source file is identified, and if the state identifier is a first state identifier, the source file may be copied to a destination file directory according to the path information; if the state identifier is a second state identifier, deleting the target file corresponding to the source file according to the path information; if the state identifier is a third state identifier, replacing the target file corresponding to the source file according to the path information. Therefore, the source files in different states can be correspondingly processed, and incremental version updating is realized.
For the embodiment of the present invention, if the state identifier is the first state identifier, copying the source file to a destination file directory according to the path information, which specifically includes: defining a version warehouse address; adding the source file to a version repository according to the version repository address; and creating a target file directory according to the path information, and copying the source file to the target file directory.
The process of defining the version repository address and adding the source file to the version repository is described above, and is not described herein again. Specifically, a version repository address may be defined, the source file is added to a version repository according to the version repository address, a target file directory is created according to the path information, and the source file is copied to the target file directory. It should be noted that, as for the newly added file, there is usually no target file directory, so that a target file directory is created at a corresponding position according to the path information, so that the source file can be copied to the target file directory, and incremental version update is implemented.
204. And compiling the source file to obtain a class file or a resource file which has a mapping relation with the source file.
The class file can be a class bytecode file in a java project, and the resource file can be a configuration file in the java project, including properties form and XML form, for solving the hard coding problem. For the embodiment of the invention, the mvn build command can be automatically called through a preset python script to realize the compiling processing of the source file, and the class file or the resource file obtained by compiling can be stored in a classes folder under a root directory. After compiling, establishing a mapping relation between the source file and the compiled file so as to copy, replace or delete the compiled file in the following process.
205. And generating a version updating log according to the source file and the modified content information of the source file.
The version update log may be specifically used to describe the incremental version update of this time. In an actual application scenario, the version update log may be generated in a project name + time manner. In addition, the unimpeded incremental publishing process can be realized by accessing jenkins or ansible programs as a part of the automatic publishing process. Jenkins is an open-source continuous integration tool providing a friendly operation interface, originates from Hudson, and is mainly used for continuously and automatically constructing/testing software projects and monitoring the running of external tasks. The infrastructure is an open source configuration management tool, and can be used for automatically tasks and deploying application programs to realize IT infrastructure. The embodiment of the invention can more clearly display the file modification record of the incremental version update by generating the version update log, and can realize the automatic flow of updating and releasing the incremental version by accessing the automatic program, thereby improving the efficiency of updating the incremental version.
The invention provides an incremental version updating method, which comprises the steps of obtaining a modification log under a preset condition through a source branch based on a version control system; analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier and path information of a source file; merging the source files under the source branch into a target branch; and correspondingly processing the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating. Therefore, conflict combination and processing of the source files can be automatically realized through the preset python script, the updating efficiency and accuracy are improved, and risks in the updating process are reduced.
Further, as a specific implementation of fig. 1, an embodiment of the present invention provides an incremental version updating apparatus, as shown in fig. 3, where the apparatus includes: an acquisition unit 31, a parsing unit 32, a merging unit 33 and a processing unit 34.
The obtaining unit 31 may be configured to obtain a modification log under a preset condition based on a source branch of a version control system;
the analyzing unit 32 may be configured to analyze the modification log to obtain source file information, where the source file information includes a state identifier of a source file, modification content information, and path information;
the merging unit 33 may be configured to merge the source files in the source branch into the target branch;
the processing unit 34 may be configured to perform corresponding processing on the source file according to the state identifier and the path information of the source file, so as to implement incremental version updating.
Further, the parsing unit 32 includes:
the configuration module 321 may be configured to configure regular expressions according to the state identifier, the modified content information, and the path information to be obtained, respectively;
the parsing module 322 may be configured to parse the modification log by using the regular expression to obtain the state identifier, the modification content information, and the path information of the source file.
Further, the merging unit 33 includes:
a defining module 331, which may be used to define a version repository address, a source file path, and a target file path;
the merging module 332 may be configured to merge the source file from a source branch to a preset target branch according to a preset conflict merging policy, the version repository address, the source file path, and the target file path.
Further, the processing unit 34 includes:
an identifying module 341, configured to identify a status identifier of the source file;
the first processing module 342 may be configured to copy the source file to a destination file directory according to the path information if the state identifier is the first state identifier;
the second processing module 343, configured to delete, if the state identifier is a second state identifier, the target file corresponding to the source file according to the path information;
the third processing module 344 may be configured to, if the state identifier is a third state identifier, replace the target file corresponding to the source file according to the path information.
Optionally, the apparatus further comprises:
the compiling unit 35 may be configured to compile the source file to obtain a class file or a resource file having a mapping relationship with the source file.
Further, the first processing module 342 is specifically configured to define a version repository address; adding the source file to a version repository according to the version repository address; and creating a target file directory according to the path information, and copying the source file to the target file directory.
Optionally, the apparatus further comprises:
the generating unit 36 may be configured to generate a version update log according to the source file and the modified content information of the source file.
It should be noted that other corresponding descriptions of the functional modules related to the incremental version updating apparatus provided in the embodiment of the present invention may refer to the corresponding description of the method shown in fig. 1, and are not described herein again.
The invention provides an incremental version updating device, which obtains a modification log under a preset condition through a source branch based on a version control system; analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier and path information of a source file; merging the source files under the source branch into a target branch; and correspondingly processing the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating. Therefore, conflict combination and processing of the source files can be automatically realized through the preset python script, the updating efficiency and accuracy are improved, and risks in the updating process are reduced.
Based on the method shown in fig. 1, correspondingly, an embodiment of the present invention further provides a storage medium, where at least one executable instruction is stored in the storage medium, and the executable instruction causes a processor to perform the following steps: based on a source branch of a version control system, acquiring a modification log under a preset condition; analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier and path information of a source file; merging the source files under the source branch into a target branch; and correspondingly processing the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating.
Based on the above embodiments of the method shown in fig. 1 and the apparatus shown in fig. 3, the embodiment of the present invention further provides a computer device, as shown in fig. 4, including a processor (processor)41, a communication Interface (communication Interface)42, a memory (memory)43, and a communication bus 44. Wherein: the processor 41, the communication interface 42, and the memory 43 communicate with each other via a communication bus 44. A communication interface 44 for communicating with network elements of other devices, such as clients or other servers. The processor 41 is configured to execute a program, and may specifically execute relevant steps in the above incremental version updating method embodiment. In particular, the program may include program code comprising computer operating instructions. The processor 41 may be a central processing unit CPU or an application Specific integrated circuit asic or one or more integrated circuits configured to implement embodiments of the present invention.
The terminal comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs. And a memory 43 for storing a program. The memory 43 may comprise a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory), such as at least one disk memory. The program may specifically be adapted to cause the processor 41 to perform the following operations: based on a source branch of a version control system, acquiring a modification log under a preset condition; analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier and path information of a source file; merging the source files under the source branch into a target branch; and correspondingly processing the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating.
According to the technical scheme, the modification log under the preset condition can be acquired based on the source branch of the version control system; analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier and path information of a source file; merging the source files under the source branch into a target branch; and correspondingly processing the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating. Therefore, conflict combination and processing of the source files can be automatically realized through the preset python script, the updating efficiency and accuracy are improved, and risks in the updating process are reduced.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. An incremental version update method, comprising:
based on a source branch of a version control system, acquiring a modification log under a preset condition;
analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier and path information of a source file;
merging the source files under the source branch into a target branch;
and correspondingly processing the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating.
2. The method of claim 1, wherein parsing the modification log to obtain source file information comprises:
respectively configuring regular expressions according to the state identification, the modified content information and the path information to be acquired;
and analyzing the modification log by using the regular expression to obtain the state identification, the modification content information and the path information of the source file.
3. The method of claim 1, wherein merging source files from the source branch into a target branch comprises:
defining a version warehouse address, a source file path and a target file path;
and merging the source file from a source branch to a preset target branch according to a preset conflict merging strategy, the version warehouse address, the source file path and the target file path.
4. The method according to claim 1, wherein the state identifier includes a first state identifier, a second state identifier, and a third state identifier, and performing corresponding processing on the source file under the target branch according to the state identifier and the path information to implement incremental version update includes:
identifying a state identifier of the source file;
if the state identifier is a first state identifier, copying the source file to a target file directory according to the path information;
if the state identifier is a second state identifier, deleting a target file corresponding to the source file according to the path information;
and if the state identifier is a third state identifier, replacing the target file corresponding to the source file according to the path information.
5. The method according to claim 1, wherein before performing corresponding processing on the source file under the target branch according to the state identifier and the path information to implement incremental version update, the method further comprises:
and compiling the source file to obtain a class file or a resource file which has a mapping relation with the source file.
6. The method according to claim 4, wherein copying the source file to a destination file directory according to the path information if the state identifier is the first state identifier comprises:
defining a version warehouse address;
adding the source file to a version repository according to the version repository address;
and creating a target file directory according to the path information, and copying the source file to the target file directory.
7. The method according to claim 1, wherein the source file information further includes modified content information, and after the source file is processed accordingly according to the state identifier and the path information of the source file to implement the incremental version update, the method further includes:
and generating a version updating log according to the source file and the modified content information of the source file.
8. An incremental version update apparatus, comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a modification log under a preset condition based on a source branch of a version control system;
the analysis unit is used for analyzing the modification log to obtain source file information, wherein the source file information comprises a state identifier and path information of a source file;
the merging unit is used for merging the source files under the source branch into a target branch;
and the processing unit is used for carrying out corresponding processing on the source file under the target branch according to the state identifier and the path information so as to realize incremental version updating.
9. A storage medium having a computer program stored thereon, the storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform operations corresponding to the incremental version update method of any one of claims 1-7.
10. A computer device comprising a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus, and the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the incremental version update method according to any one of claims 1 to 7.
CN202010712392.XA 2020-07-22 2020-07-22 Incremental version updating method and device, storage medium and computer equipment Active CN111796855B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010712392.XA CN111796855B (en) 2020-07-22 2020-07-22 Incremental version updating method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010712392.XA CN111796855B (en) 2020-07-22 2020-07-22 Incremental version updating method and device, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN111796855A true CN111796855A (en) 2020-10-20
CN111796855B CN111796855B (en) 2023-06-09

Family

ID=72827733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010712392.XA Active CN111796855B (en) 2020-07-22 2020-07-22 Incremental version updating method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN111796855B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113110868A (en) * 2021-04-07 2021-07-13 网易(杭州)网络有限公司 File merging method and device, computer equipment and storage medium
WO2022222626A1 (en) * 2021-04-21 2022-10-27 北京字节跳动网络技术有限公司 Incremental source code acquisition method and apparatus, electronic device and storage medium
CN117055936A (en) * 2023-02-27 2023-11-14 武汉路特斯科技有限公司 Incremental upgrade method, system, computer device and readable storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101932999A (en) * 2007-12-20 2010-12-29 汇丰技术股份有限公司 Automated methods and systems for developing and deploying projects in parallel
US20130138695A1 (en) * 2011-11-30 2013-05-30 Autodesk, Inc. Database versioning system
CN104123126A (en) * 2013-04-26 2014-10-29 阿里巴巴集团控股有限公司 Method and device for generating merge conflict record list
WO2014206046A1 (en) * 2013-06-25 2014-12-31 Tencent Technology (Shenzhen) Company Limited A method, equipment and system of incremental update
CN105404519A (en) * 2015-12-07 2016-03-16 青岛海信电器股份有限公司 Version control method, code testing method and system
CN106502725A (en) * 2016-09-30 2017-03-15 歌尔科技有限公司 The upgrade method of application program, equipment and electronic equipment
WO2017185606A1 (en) * 2016-04-29 2017-11-02 乐视控股(北京)有限公司 Overlay mechanism-based apk development method and system
CN108733400A (en) * 2018-04-27 2018-11-02 新光互联投资管理有限公司 A kind of hot update method of App increments and service system
CN109086071A (en) * 2018-08-22 2018-12-25 平安普惠企业管理有限公司 A kind of method and server of management software version information
CN109753289A (en) * 2019-01-14 2019-05-14 网易(杭州)网络有限公司 A kind of fine arts resource merging method, device, electronic equipment and storage medium
CN110336695A (en) * 2019-06-21 2019-10-15 威富通科技有限公司 A kind of method and server of deployment and maintenance application
US20200004528A1 (en) * 2018-06-28 2020-01-02 Microsoft Technology Licensing, Llc Formalized propagation and approval of code changes in a tightly coupled environment

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101932999A (en) * 2007-12-20 2010-12-29 汇丰技术股份有限公司 Automated methods and systems for developing and deploying projects in parallel
US20130138695A1 (en) * 2011-11-30 2013-05-30 Autodesk, Inc. Database versioning system
CN104123126A (en) * 2013-04-26 2014-10-29 阿里巴巴集团控股有限公司 Method and device for generating merge conflict record list
WO2014206046A1 (en) * 2013-06-25 2014-12-31 Tencent Technology (Shenzhen) Company Limited A method, equipment and system of incremental update
CN105404519A (en) * 2015-12-07 2016-03-16 青岛海信电器股份有限公司 Version control method, code testing method and system
WO2017185606A1 (en) * 2016-04-29 2017-11-02 乐视控股(北京)有限公司 Overlay mechanism-based apk development method and system
CN106502725A (en) * 2016-09-30 2017-03-15 歌尔科技有限公司 The upgrade method of application program, equipment and electronic equipment
CN108733400A (en) * 2018-04-27 2018-11-02 新光互联投资管理有限公司 A kind of hot update method of App increments and service system
US20200004528A1 (en) * 2018-06-28 2020-01-02 Microsoft Technology Licensing, Llc Formalized propagation and approval of code changes in a tightly coupled environment
CN109086071A (en) * 2018-08-22 2018-12-25 平安普惠企业管理有限公司 A kind of method and server of management software version information
CN109753289A (en) * 2019-01-14 2019-05-14 网易(杭州)网络有限公司 A kind of fine arts resource merging method, device, electronic equipment and storage medium
CN110336695A (en) * 2019-06-21 2019-10-15 威富通科技有限公司 A kind of method and server of deployment and maintenance application

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HUPPERT: "windows下,分析svn日志提取变更", 《HTTPS://BLOG.CSDN.NET/WHHLPO/ARTICLE/DETAILS/74171946》 *
HUPPERT: "windows下,分析svn日志提取变更", 《HTTPS://BLOG.CSDN.NET/WHHLPO/ARTICLE/DETAILS/74171946》, 3 July 2017 (2017-07-03), pages 1 - 5 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113110868A (en) * 2021-04-07 2021-07-13 网易(杭州)网络有限公司 File merging method and device, computer equipment and storage medium
CN113110868B (en) * 2021-04-07 2023-08-08 网易(杭州)网络有限公司 File merging method, device, computer equipment and storage medium
WO2022222626A1 (en) * 2021-04-21 2022-10-27 北京字节跳动网络技术有限公司 Incremental source code acquisition method and apparatus, electronic device and storage medium
CN117055936A (en) * 2023-02-27 2023-11-14 武汉路特斯科技有限公司 Incremental upgrade method, system, computer device and readable storage medium

Also Published As

Publication number Publication date
CN111796855B (en) 2023-06-09

Similar Documents

Publication Publication Date Title
US10095489B1 (en) GUI-based application template for containerized application software development
US10740093B2 (en) Advanced packaging techniques for improving work flows
KR101911793B1 (en) Managing data set objects in a dataflow graph that represents a computer program
US11429365B2 (en) Systems and methods for automated retrofitting of customized code objects
US10621211B2 (en) Language tag management on international data storage
US7194475B2 (en) Method, system, and program for performing an impact analysis of program statements in at least one source code file
CN111796855B (en) Incremental version updating method and device, storage medium and computer equipment
US20240045850A1 (en) Systems and methods for database orientation transformation
US20190361792A1 (en) System for debugging a client synchronization service
US20150261766A1 (en) Method and apparatus for determining a range of files to be migrated
US11704114B2 (en) Data structures for managing configuration versions of cloud-based applications
WO2020010724A1 (en) Front-end static resource management method, apparatus, computer device and storage medium
CN110941547A (en) Automatic test case library management method, device, medium and electronic equipment
US11099837B2 (en) Providing build avoidance without requiring local source code
US11966732B2 (en) Data structures for managing configuration versions of cloud-based applications
CN113515303B (en) Project transformation method, device and equipment
US8719766B1 (en) System and method for identifying and adding files to a project manifest
White et al. Datadeps. jl: Repeatable data setup for reproducible data science
US20190361793A1 (en) System for debugging a client synchronization service
CN117008920A (en) Engine system, request processing method and device, computer equipment and storage medium
CN117667109A (en) Environment deployment method and device, electronic equipment and storage medium
US11256602B2 (en) Source code file retrieval
US11461217B2 (en) Transferring data from a source complex variable to a target complex variable
CN113504904A (en) User-defined function implementation method and device, computer equipment and storage medium
White et al. Datadeps. jl: Repeatable data setup for replicable data science

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