Git机

gitmachine的Python项目详细描述


gitmachine是一个python库,旨在模拟git签出过程 处理URL别名和可能需要临时重写子模块的情况。

这基于baserock中的子模块覆盖模式,但可以使用 独立于基岩建造工具。

下面是如何使用它

# Set some aliases, this is usually a dictionary of prefix mappings. Here # we set a single prefix meaning, wherever we see ‘upstream:’, substitute # it for ‘git://git.baserock.org/delta’

aliases = { ‘upstream:’: ‘git://git.baserock.org/delta/’}

# Make a GitMachine, specifying a ‘gits’ directory, a ‘tmp’ directory and # the aliases. ‘gits’ is where the gits end up stored. GitMachine will name # them in a standard way.

gitmachine = GitMachine(‘gits’, ‘tmp’, aliases)

# We’re going to check out ansible at the ref ebc8d48d34296fe010096f044e2b7591df37a622, # using the upstream baserock repository. We need to make a submodule mask, which maps # the path of the submodule in the main repository to an alternate url. It looks like # this:

ansible = {‘lib/ansible/modules/core’: { ‘url’: ‘upstream:ansible-modules-core.git’ },
‘v2/ansible/modules/core’: { ‘url’: ‘upstream:ansible-modules-core.git’ }, ‘v2/ansible/modules/extras’: { ‘url’: ‘upstream:ansible-modules-extras.git’ }, ‘lib/ansible/modules/extras’: { ‘url’: ‘upstream:ansible-modules-extras.git’ }}

# Use the arrange_into_folder method to clone upstream:ansible from git.baserock.org, # also passing in the ref, the submodule mask, and a folder, to clone into the folder # using the overriden sources. Here it will evaluate upstream:ansible and clone it # into the folder ‘ansible.build’, using the submodule override mask.

gitmachine.arrange_into_folder(‘upstream:ansible’, ‘ebc8d48d34296fe010096f044e2b7591df37a622’, ansible, ‘ansible.build’)

gitmachine也递归地工作。qt5主机递归校验的一个例子 存储库可以在“quick check.py”中找到

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Spring、JPA和hibernate的java问题   如何将JMC(Java任务控制)连接到ubuntu中的远程JVM?   java如何将eventListener的结果存储为对象?   java在安卓中,点击一个按钮,我如何停止发送循环中发送的消息   java打开活动中的电子邮件   使用velocity模板打印JasperReports   java无法在自定义信息窗口上拨号   java如何在jsonb postgresql中查询并转换为谓词JPA   java更好地理解J2EE环境中的异常和日志记录   java打印多个文件   java无法使用API v2 Foreman 1.7.1创建主机   HTML单一提交类型按钮在java中不起作用   java调用静态方法的实例   ViewPage中替换片段的java问题   C++在java中创建数组(2D)而不初始化内部数组   java如何在NetBeans中同时更改变量名称的多个实例?   如何完成这个关于集合的java程序   java如何选择使用selenium从下拉菜单动态生成的元素?