[英]Mercurial - How to get a list of files that are different between two repositories
I have two related Mercurial repositories. 我有两个相关的Mercurial存储库。 Repository A has a lot of changes that are not in repository B. I want to generate a list of file names that are different between repository A and repository B
存储库A有很多更改,这些更改不在存储库B中。我想生成一个列表,列出存储库A和存储库B之间不同的文件名
Here is what I have so far: 这是我到目前为止的内容:
A text file named hg_outconfig.txt with the following text: 名为hg_outconfig.txt的文本文件,其中包含以下文本:
changeset = "{file_mods}\n{file_dels}\n{file_adds}"
file_mod = "{file_mod}\n"
file_add = "{file_add}\n"
file_del = "{file_del}\n"
Then I am running the commands: 然后我运行命令:
cd PATH_TO_REPO_A
hg -q outgoing URL_TO_REPO_B --style c:\\hg_outconfig.txt | sort
This does list all files in repo A that have changed, but it also lists files in repo A that have changes from previous commits that are already in repo B. I want just a list of files that have current differences between repo A and repo B. 这确实列出了仓库A中所有已更改的文件,但它也列出了仓库A中与仓库B中以前的提交有更改的文件。我只想列出仓库A和仓库B之间当前存在差异的文件列表。 。
... --template "{files}\\n"
will give you far from nice and pretty, but correct output ... --template "{files}\\n"
不会给你带来... --template "{files}\\n"
,但输出正确
From my test 从我的测试
hg incoming --template="{files}\n" -q
footer.php functions.php header.php readme.txt search.php style.css
comments.php functions.php header.php readme.txt sidebar.php style.css
readme.txt sidebar.php style.css
functions.php readme.txt screenshot.png style.css
4 strings are 4 changesets, files in changeset are space-separated 4个字符串是4个变更集,变更集中的文件以空格分隔
Ok I figured out how to do this. 好吧,我想出了怎么做。 In order to list outgoing files and exclude merges you can use the -M argument with the outgoing command.
为了列出传出文件并排除合并,可以在传出命令中使用-M参数。 So
所以
hg -q outgoing -M remote_repo_url
will give you a list of files that are different between the two repositories. 将为您提供两个存储库之间不同的文件列表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.