tags:

views:

104

answers:

1

The command

hg outgoing

compares the local repo 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?

+7  A: 

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
Ry4an
In the last couple of lines, shouldn't that be the `outgoing` hook, not the `commit` hook?
Niall C.
Thanks, Niall. I actually wanted the post-push hook, since that's what we're tracking, but post-commit was definitely wrong.
Ry4an
Makes sense. Thanks @Ry4an for the good idea.
Grumdrig