gpt4 book ai didi

powershell - 如何在Mercurial中打印特定文件的所有修订的内容?

转载 作者:行者123 更新时间:2023-12-03 01:24:10 24 4
gpt4 key购买 nike

假设我有README文件的5个修订版。如何在Mercurial中查看它们?

能够限制输出会很好,类似于:

hg log -l 10

我正在使用 PowerShell,因此也欢迎使用组合解决方案。

最佳答案

我不知道Powershell语法,但是您正在寻找hg cat命令。结合your other question的答案,我将在Unix shell中进行此操作(在我的情况下为zsh):

for r in $(hg log --template '{rev} ' README); do hg cat -r $r README; done

我首先获得 README更改的所有修订。它们将被放入这样的大字符串中:
% hg log --template '{rev} ' README
822 804 688 681 629 539 538

然后,您遍历这些修订号,并在每个修订号上调用 hg cat

关于powershell - 如何在Mercurial中打印特定文件的所有修订的内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1078936/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com