When I type hg outgoing, I get a response like this:
comparing with ssh://server:1234/path/to/repo
and a delay while it communicates over the network.
Why is this network traffic necessary? Is there something fundamental about Mercurial which means it can’t remember which commits have been pushed, and which haven’t?
Is there an alternative command which can give me similar information without having to communicate over the network?
As Mercurial is a distributed system, there are multiple ways for your changes to get from your local repo to the remote repo.
For example:
However, if you have Mercurial 2.1 or later you can use
hg phaseto determine which changesets have been pushed. Assuming you don’t usehg phaseto change the status of any changesets then the changesets with a phase ofdraftorsecrethave not been pushed and those with a phase ofpublichave. Useto see unpublished changesets.
It won’t catch the two examples I gave above but it will probably be good enough if you just want to know which changesets you have not pushed.
Look here or check
hg help phasesfor instructions on how to work with phases.