CN111338687A - Method for migrating svn version libraries to git version libraries using python - Google Patents
Method for migrating svn version libraries to git version libraries using python Download PDFInfo
- Publication number
- CN111338687A CN111338687A CN202010118099.0A CN202010118099A CN111338687A CN 111338687 A CN111338687 A CN 111338687A CN 202010118099 A CN202010118099 A CN 202010118099A CN 111338687 A CN111338687 A CN 111338687A
- Authority
- CN
- China
- Prior art keywords
- svn
- program
- project
- git
- submission
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 12
- 238000013508 migration Methods 0.000 abstract description 3
- 230000005012 migration Effects 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000019771 cognition Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000013509 system migration Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a method for migrating an svn version library to a git version library by using Python, (1) configuring items in a Python program, configuring user information files locally, and then starting the program; (2) analyzing SVN submission history by a program, reading a pre-configured user information file, acquiring history submission records under a specified SVN project, and circularly traversing the acquired SVN history submission records; (3) executing a program command to copy the record from the version obtained in the last step to the latest version in the SVN project to a Git local path; (4) setting an ignore directory, creating and opening a new file under the project directory, gitignore, and submitting the file of the ignore directory character string to Git, namely representing the submission of the ignore directory; (5) starting to submit, executing a program command to establish connection between a local warehouse and a remote warehouse and acquiring a returned execution result; (6) the routine is ended. The invention automatically migrates under the condition of correct configuration information, thereby improving the migration efficiency.
Description
Technical Field
The invention relates to the technical field of control system migration, in particular to a method for migrating an svn version library to a git version library by using python.
Background
In the current IT industry, most source codes are managed through a version control system, the famous version control system comprises SVN, Git and the like, Git is a distributed version control system and is superior to SVN in the aspects of branch control and distributed development in the current general cognition, a large number of IT companies are required to be migrated from SVN version control to Git version control in the development process, but the SVN and Git version control systems are different in user systems, different in storage and different in service, and how to effectively and quickly migrate the version control system is a major problem which needs to be considered in the migration process.
In the prior art, for example, historical versions in the SVN version control system are abandoned, and the latest version code is stripped off and SVN control is introduced into a new Git version control system project. All historical version records of the method will be lost.
For example, the self-contained function of the Git tool is migrated from the SVN to the Git, and the function is single, so that secondary submission is needed.
Disclosure of Invention
The invention provides a method for migrating an SVN version library to a Git version library by using python, which aims at the problems, reserves the latest SVN submission history, automatically analyzes the developer who submits the SVN recently, automatically adds an override compilation catalog and can directly submit the SVN to a remote Git version control system.
In order to achieve the purpose, the invention adopts the following technical scheme:
a method of migrating an svn version library to a git version library using python, comprising the steps of:
(1) firstly, configuring a project SVN path, a Git project path to be submitted, a local storage directory and a project name in a Python program, configuring a user information file locally, and then starting the program;
(2) analyzing SVN submission history by a program, reading a preconfigured user information file, acquiring a history submission record under a specified SVN project, and circularly traversing the acquired SVN history submission record:
obtaining a submitter for submitting a record, judging whether the information of the pre-configured user contains the submitter or not, and quitting to prompt that the information of the submitter needs to be configured if the information of the submitter is not contained, wherein the information is the information of the submitter required by copying a subsequent SVN project to a Git local project;
acquiring the first 100 submitted records at most and acquiring the earliest submitted record;
(3) executing a program command to copy the record from the version obtained in the last step to the latest version in the SVN project to a Git local path, if the program execution returns a failure status code, prompting the copy failure, and the program exits;
(4) setting an ignore directory, creating and opening a new file under the project directory, gitignore, and submitting the file of the ignore directory character string to Git, namely representing the submission of the ignore directory; if the program execution returns a failure status code, the failure of submission is prompted, and the program exits;
(5) starting to submit, firstly executing a program command to establish connection between a local warehouse and a remote warehouse, acquiring a returned execution result, and if the program execution returns a failure status code, prompting that the remote connection addition fails and the program exits; then executing the program command, submitting the local project to a remote warehouse, acquiring a returned execution result, and if the program execution returns a failure status code, prompting that the submission fails and quitting the program;
(6) the routine is ended.
Compared with the prior art, the invention has the following advantages and prominent effects:
the invention establishes a universal method to migrate the SVN version library to the Git version library, provides functions such as retaining recent history and automatically adding neglected paths, can automatically migrate programs under the condition of correct configuration information without too much manual processing, and improves the migration efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
FIG. 1 is a schematic flow diagram of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, (1) first configuring a project SVN path, a Git project path to be submitted, a local storage directory, and a project name in a Python program, configuring a user information file locally, and then starting the program;
(2) analyzing SVN submission history by a program, reading a preconfigured user information file, acquiring a history submission record under a specified SVN project, and circularly traversing the acquired SVN history submission record:
obtaining a submitter for submitting a record, judging whether the information of the pre-configured user contains the submitter or not, and quitting to prompt that the information of the submitter needs to be configured if the information of the submitter is not contained, wherein the information is the information of the submitter required by copying a subsequent SVN project to a Git local project;
acquiring the first 100 submitted records at most and acquiring the earliest submitted record;
(3) executing a program command to copy the record from the version obtained in the last step to the latest version in the SVN project to a Git local path, if the program execution returns a failure status code, prompting the copy failure, and the program exits;
(4) the ignore directory is reset (generally used for ignoring program compiling directories which do not need to be submitted), a new file is created and opened under the project directory, the ignore directory (such as:/< built >) character string is sent to the file, namely, the file represents the submission of the ignore directory, and the gitignore file is submitted to Git. If the program execution returns a failure status code, the failure of submission is prompted, and the program exits;
(5) starting to submit, firstly executing a program command to establish connection between a local warehouse and a remote warehouse, acquiring a returned execution result, and if the program execution returns a failure status code, prompting that the remote connection addition fails and the program exits; then executing the program command, submitting the local project to a remote warehouse, acquiring a returned execution result, and if the program execution returns a failure status code, prompting that the submission fails and quitting the program;
(6) the routine is ended.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.
Claims (2)
1. A method of migrating an svn version library to a git version library using python, characterized by: comprises the following steps:
(1) firstly, configuring a project SVN path, a Git project path to be submitted, a local storage directory and a project name in a Python program, configuring a user information file locally, and then starting the program;
(2) analyzing SVN submission history by a program, reading a pre-configured user information file, acquiring history submission records under a specified SVN project, and circularly traversing the acquired SVN history submission records;
(3) executing a program command to copy the record from the version obtained in the last step to the latest version in the SVN project to a Git local path, if the program execution returns a failure status code, prompting the copy failure, and the program exits;
(4) setting an ignore directory, creating and opening a new file under the project directory, gitignore, and submitting the file of the ignore directory character string to Git, namely representing the submission of the ignore directory; if the program execution returns a failure status code, the failure of submission is prompted, and the program exits;
(5) starting to submit, firstly executing a program command to establish connection between a local warehouse and a remote warehouse, acquiring a returned execution result, and if the program execution returns a failure status code, prompting that the remote connection addition fails and the program exits; then executing the program command, submitting the local project to a remote warehouse, acquiring a returned execution result, and if the program execution returns a failure status code, prompting that the submission fails and quitting the program;
(6) the routine is ended.
2. The method of migrating an svn version library to a git version library using python as claimed in claim 1 wherein: the step (2) of circularly traversing the acquired svn historical submission records comprises the following steps:
obtaining a submitter for submitting a record, judging whether the information of the pre-configured user contains the submitter or not, and quitting to prompt that the information of the submitter needs to be configured if the information of the submitter is not contained, wherein the information is the information of the submitter required by copying a subsequent SVN project to a Git local project;
the first 100 most committed records are obtained, the earliest committed record is obtained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010118099.0A CN111338687A (en) | 2020-02-26 | 2020-02-26 | Method for migrating svn version libraries to git version libraries using python |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010118099.0A CN111338687A (en) | 2020-02-26 | 2020-02-26 | Method for migrating svn version libraries to git version libraries using python |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111338687A true CN111338687A (en) | 2020-06-26 |
Family
ID=71181964
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010118099.0A Pending CN111338687A (en) | 2020-02-26 | 2020-02-26 | Method for migrating svn version libraries to git version libraries using python |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111338687A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114661339A (en) * | 2022-05-26 | 2022-06-24 | 浙江所托瑞安科技集团有限公司 | Method and device for automatically submitting local data to remote server |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106775714A (en) * | 2016-12-15 | 2017-05-31 | 武汉斗鱼网络科技有限公司 | A kind of code synchronisation method and system |
US9747095B1 (en) * | 2015-04-21 | 2017-08-29 | Jpmorgan Chase Bank, N.A. | System and method for automated content and software migration |
-
2020
- 2020-02-26 CN CN202010118099.0A patent/CN111338687A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9747095B1 (en) * | 2015-04-21 | 2017-08-29 | Jpmorgan Chase Bank, N.A. | System and method for automated content and software migration |
CN106775714A (en) * | 2016-12-15 | 2017-05-31 | 武汉斗鱼网络科技有限公司 | A kind of code synchronisation method and system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114661339A (en) * | 2022-05-26 | 2022-06-24 | 浙江所托瑞安科技集团有限公司 | Method and device for automatically submitting local data to remote server |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7356816B2 (en) | Method and apparatus for multiplatform migration | |
AU2003204800B2 (en) | System and method for issuing a message to a program | |
CN111104151B (en) | Shell script-based Git code simplification management method | |
US20060080329A1 (en) | Systems and methods for creating a template from an existing file | |
CN111796855B (en) | Incremental version updating method and device, storage medium and computer equipment | |
CN110737437A (en) | compiling method and device based on code integration | |
Fazzini et al. | Apimigrator: an api-usage migration tool for android apps | |
CN111338687A (en) | Method for migrating svn version libraries to git version libraries using python | |
CN113297081B (en) | Execution method and device of continuous integrated pipeline | |
US20240111521A1 (en) | Code processing method and system, and computer cluster, medium, and program product | |
CN112379865B (en) | Software development framework updating method based on Maven plug-in mechanism | |
CN117608807A (en) | Automatic creation and dependency automatic construction method, system and medium for data scheduling task | |
CN110737438A (en) | data processing method and device | |
Kano | Kachako: A Hybrid-Cloud Unstructured Information Platform for Full Automation of Service Composition, Scalable Deployment and Evaluation: Natural Language Processing as an Example | |
CN113126998B (en) | Incremental source code acquisition method and device, electronic equipment and storage medium | |
CN114625373A (en) | Application conversion method and device, electronic equipment and storage medium | |
CN113010189B (en) | Database installation method, device, equipment and storage medium | |
US9389838B2 (en) | Method for creating a computer software compiler for client server computing | |
JP6705482B2 (en) | System construction parameter management device, system construction parameter management system, system construction parameter management method, and system construction parameter management program | |
CN113901025A (en) | Database management method, device, equipment and storage medium | |
CN114089965A (en) | Program development project management method and device based on monolithic code warehouse Monorepo | |
CN115562649B (en) | Auxiliary writing method and system for source codes of computer mixed program language | |
JP2012093979A (en) | Osgi bundle and deployment package automatic creation system, automatic creation method and automatic creation tool | |
US20240168851A1 (en) | System and method for scanning file systems | |
Sohlich | Go Standard Library Cookbook: Over 120 specific ways to make full use of the standard library components in Golang |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200626 |