开发者

Local-only version of `hg outgoing`?

The command

hg outgoing

compares the local 开发者_如何学JAVArepo to the default push location; it accesses the push location to do it.

I'd like to ask the question "have I checked in changes in my local repo since my last hg push?" without having to access the remote repo.

It seems like there might be enough info in the local repo to figure that out; if so, is there a command to determine that?


There isn't a built-in way to do it. Tracking what has been pushed would be slightly tricky because you can push to multiple places. And you can pull from multiple places. So I could push to X then push to Y then pull from Z and my 'hg outgoing X' output is difficult to predict local-only.

That said you could use a command like this:

hg tag --local --force -r tip pushed

That creates a local-only tag pointing to the current tip. If you always run that after pushing you'll always know what was last pushed.

You could create a post-push hook to do that in your .hgrc:

[hook]
post-push = hg tag --local --force -r tip pushed
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜