简体   繁体   English

Mercurial-如何获取两个存储库之间不同的文件列表

[英]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.

相关问题 如何获取两个git存储库之间的changsets列表 - How to get a list of changsets between two git repositories GitHub:如何在存储库中维护文件的两个不同版本? - GitHub: how to maintain two different versions of files different in repositories? 如何在Mercurial中的hg日志中获取修改后的文件列表及其修订? - How to get modified files list along with their revision in hg log in Mercurial? Mercurial [HG] - 获取.hgignore排除文件的列表 - Mercurial [HG] - Get the list of .hgignore excluded files 您将如何使用它们共有的文件夹/文件更新两个略有不同的存储库? - How would you keep two slightly different repositories updated with the folders/files that they have in common? 使用Mercurial记录两个文件之间的代码转换 - Recording transition of code between two files using Mercurial 人们如何管理存储在多个(Mercurial)存储库中的公共库文件的更改? - How do people manage changes to common library files stored across mutiple (Mercurial) repositories? 如何在浏览器中正确提供Mercurial存储库? - How to serve Mercurial repositories in the browser correctly? Mercurial存储库被.hgignore和.hgtags等隐藏文件损坏 - Mercurial repositories corrupted by hidden files like .hgignore and .hgtags 如何在mercurial中找到两个标签之间的变更集? - How do you find the changesets between two tags in mercurial?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM