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第三方库


热门话题
java Jackson json双向对象引用   java从isValid()方法调用进一步的验证器?   通过黑名单进行正则表达式Java字符串验证   JavaSpring集成转发原始消息并在处理后回复   jacocomavenplugin中的java是准备目标是必要的吗?   java实际上是在移动鼠标   java使用gradle创建可执行jar   java ComparisonFailure看不到物理差异   java如何:在重新绘制之前清除JPanel,然后运行另一个类并移动对象   java银行帐户不工作   Java命令行cmd用户输入UI   java引用外部静态连接方法中的变量   avr在java中获取AVRDUDE flash进程状态   带参数的Groovy模拟Java类   类型会话中的java setConfig(属性)不适用于参数(字符串、字符串)”