incoming exit status

Matt Mackall mpm at selenic.com
Wed Nov 10 21:04:07 CST 2010


On Wed, 2010-11-10 at 22:35 +0100, Jason Harris wrote:
> Thinking about this more, perhaps incoming and outgoing should have the option '--count' which would have the effect that instead of returning a verbose message, it would simply return the incoming / outgoing count. In fact I internally to MacHg use:
>   hg incoming --quiet --template "-"
> And then count the string length of the result to get the incoming / outgoing counts.

Not a bad notion, but I'm afraid I don't like it much: we'd end up
growing new --count options on a bunch of commands (incoming, outgoing,
log, possibly others) and those already have too many options. If there
were some way to make it part of the revset query language or the
template engine instead, that'd be great.

Regarding your --template "-" solution: it's cute but you should be
aware of how slow it potentially is. The current discovery process just
finds the boundary changesets of the incoming bundle and has no way of
knowing whether that's going to be 10 or 10000 changesets without
actually starting a pull[1]. And incoming does just that: it does a real
pull, unpacks it, looks at the new changesets (and possibly their
contents) and then throws the whole thing away. Also, going through the
templater does a lot more work than the -q path to print those '-'.
You probably want to take a look at caching this bundle for the next
pull with --bundle.

[1] This is why hg summary --remote reports only "1 or more" incoming
changesets, but reports an actual count of outgoing ones - it skips the
pull step.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial mailing list