如何在myrepos(mr)配置中生成所有存储库的列表?

时间:2015-01-24 00:37:20

标签: configuration scripting

出于脚本目的,我想在myrepos(mr)配置中打印所有存储库的列表。

我有以下〜/ .mrconfig:

[hell]
checkout = git clone 'git://github.com/chrisdone/hell.git' 'hell'

假设我已经在〜/ code中克隆了存储库,当我在工作目录中运行以下命令时〜/ code:

mr list

命令说

mr list: no repositories found to work on

mr list做什么?是不是打印像vcsh list这样的配置中的所有条目的命令?提前谢谢。

1 个答案:

答案 0 :(得分:0)

如果您从示例用户家中运行mr ch,它将克隆到〜/ hell,然后mr ls会显示结果。如果你想让它解决〜/ code,你需要以下内容。

~ $ cat ~/.mrconfig 
[code/hell]
checkout = git clone 'git://github.com/chrisdone/hell.git' 'hell'
~ $ mr list
mr list: failed to chdir to /home/user/code/hell/: No such file or directory

mr list: finished (1 failed)
~ $ mkdir code
~ $ mr ch
mr checkout: /home/steven/code/hell
Cloning into 'hell'...
remote: Counting objects: 265, done.
remote: Total 265 (delta 0), reused 0 (delta 0), pack-reused 265
Receiving objects: 100% (265/265), 48.38 KiB | 0 bytes/s, done.
Resolving deltas: 100% (110/110), done.
Checking connectivity... done.

mr checkout: finished (1 ok)
~ $ mr list
mr list: /home/steven/code/hell

mr list: finished (1 ok)

或者将原始配置放在〜/ code / .mrconfig中并运行〜/ code。下的命令。