在所有子目录上运行hg pull [英] Run hg pull over all subdirectories
本文介绍了在所有子目录上运行hg pull的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从共享的父目录中更新多个汞(hg)存储库?
How can I update multiple mercurial (hg) repositories from their shared parent's directory?
/plugins/search
/plugins/overview
/plugins/chart
我想将一个分支更改为默认分支,并一次更新所有分支
I want to change a branch to default one and update them all at once
cd /plugins/search
hg update -C default
hg pull -u
推荐答案
从父目录(在这种情况下为plugins
)运行以下命令:
Run the following from the parent directory, plugins
in this case:
find . -type d -maxdepth 1 -exec hg update -C default -R {} \;
find . -type d -maxdepth 1 -exec hg pull -u -R {} \;
要澄清:
-
find .
搜索当前目录 -
-type d
查找目录,而不是文件 -
-maxdepth 1
表示一个子目录的最大深度 -
-exec {} \;
为每个查找运行自定义命令 -
hg update -C default -R {}
hg将每个存储库中的分支更改为默认值
如果在每个存储库中提取了变更集,则 -
hg pull -u -R {}
hg将更新为新的分支头
find .
searches the current directory-type d
to find directories, not files-maxdepth 1
for a maximum depth of one sub-directory-exec {} \;
runs a custom command for every findhg update -C default -R {}
hg changes branch to default in each repositoryhg pull -u -R {}
hg updates to new branch head if changesets were pulled in each repository
这篇关于在所有子目录上运行hg pull的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文