在 Mercurial (hg) 中,如果出现“hg Push”,如何查看将要推送的文件列表。已发出?
我们可以看到所有变更集和涉及使用的文件,
hg outgoing -v
但文件名都分散在变更集列表中。
有没有办法只查看发出 hg Push
时将出去的所有文件的列表?
We can see all the changesets and the files involved using
hg outgoing -v
but the filenames are all scattered in the list of changesets.
Is there a way to just see a list of all the files that will go out if hg push
is issued?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
首先,创建一个包含以下内容的文件:
假设您将其命名为 out-style.txt 并将其放入主目录中。然后你可以发出这个命令:
First, create a file with this content:
Let's say you call it out-style.txt and put it in your home directory. Then you can give this command:
一个有点被低估的功能:
hg status
可以显示任意变更集之间文件状态变化的信息。这可用于获取修订版X
和Y
之间更改的文件列表:在这种情况下,我们可以使用
hg Outgoing
来查找第一个传出变更集X
,然后查看自修订版
X
以来的文件更改。您可以将其合并到 shell 中的一行中:A somewhat under-appreciated feature:
hg status
can show information about changes in file status between arbitrary changesets. This can be used to get a list of files changed between revisionsX
andY
:In this case, we can use
hg outgoing
, to find the first outgoing changesetX
and then doto see the files changes since revision
X
. You can combine this into a single line in your shell:我通常使用
它使列表更短,但不排序。但到目前为止,我还没有遇到过这样的情况:我想要推动太多(同时检查文件),这会成为一个问题。
[编辑]
执行您想要的操作:
cut
删除files:
部分tr
将它们放在 如下sort
对结果输出进行排序,所示:
您可以将其放入 ~/outgoingfiles.sh 或其他内容中,以使其做好准备。
I usually use
It makes the listing shorter, but doesnt sort. But thus far I havent been in a situation where I want to push so much (and at the same time check the files) that its been a problem.
[Edit]
To do what you want:
cut
to remove thefiles:
parttr
to put them on separate linessort
Like so:
You can put this in ~/outgoingfiles.sh or something to have it nice and ready.
我使用 Torgoise Hg,它是一个 shell 扩展,具有“同步”视图,允许您查看传出文件在你推动他们之前。它对于提交和其他事情也很方便。
I use Torgoise Hg, which is a shell extension that has a "synchronize" view allowing you to see outgoing files before you push them. It's convenient for commits as well, and other things.
一个简单的
hg out
也可以解决这个问题。它将列出所有已提交但尚未推送签入的内容。
A simple
hg out
will also solve this.It will list all committed but yet to push checkins.