对于 Mercurial,如果我 7 天没有提交,我可以比较我所做的所有更改,但如果我曾经提交过,就不能比较?

发布于 2024-09-26 03:15:10 字数 549 浏览 7 评论 0原文

我习惯在推送到任何存储库之前比较我所做的所有更改。但我发现,如果我从未承诺那段开发时间,例如 5 天,那么我可以与其他人的代码合并,进行测试等,并且我可以 diff 或 kdiff3 并查看我所做的所有更改,删除任何更改调试代码,修复任何小问题,然后推送到存储库。

然而,如果我在这 5 天内做出了承诺,那么似乎没有简单的方法来“展示我所有的改变”。

我拥有的最接近的解决方案是:

hg log -u MyUserName -r tip:4322 --style ~/hg-style.txt | sort | uniq | xargs hg vdiff -r 4322

其中 ~/hg-style.txt 是,

changeset = "{files}"
file = "{file}\n"

在我开始为期 5 天的开发工作之前, 4322 是。然后上面可以比较我更改的所有文件,但它也包括我的队友对这些文件进行更改的更改,并且也可能有很多更改。

有什么简单的解决办法吗?

I have the habit of diff'ing all the changes I made before pushing to any repo. But I found that if I never commit for that period of development, such as for 5 days, then I can merge with other people's code, do testing, etc, and I can diff or kdiff3 and see all the changes I made, remove any debug code, fix any small things, and then push to the repo.

However, if I ever committed within this 5-day period, then it seems there is no easy way to "show all my changes".

The closest solution I have is:

hg log -u MyUserName -r tip:4322 --style ~/hg-style.txt | sort | uniq | xargs hg vdiff -r 4322

where ~/hg-style.txt is

changeset = "{files}"
file = "{file}\n"

and 4322 is before I start the 5-day development work. Then the above can diff all the files that was changed by me, but it also includes the changes of my teammates if they made changes to those files, and there can be lots of changes too.

Is there any easy solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浊酒尽余欢 2024-10-03 03:15:10

让 Mercurial 为您完成这项工作。使用 hg Outgoing 查看您已提交但未推送的内容。使用 hg outgoing --patch 来查看这些内容的实际差异。使用 hg status --rev Tip --rev 4322 来获取已更改文件的列表,就像上面所做的那样。

为了热爱一切神圣的事物,经常做出承诺!

Let mercurial do the work for you. Use hg outgoing to see what you've commited but not pushed. Use hg outgoing --patch to see the actual diffs for those. Use hg status --rev tip --rev 4322 to get the list of changed files like you're doing above.

And for the love of all things holy commit frequently!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文