incoming exit status

Jason Harris jason at jasonfharris.com
Thu Nov 11 06:42:51 UTC 2010


On Nov 11, 2010, at 4:04 AM, Matt Mackall wrote:

> 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.

Off the top of my head I would see '--count' as an option to only incoming and outgoing. And possibly log at a stretch. Which other commands would this be applicable to? (I of course believe you when say there are a bunch more commands... But I am just curious as to which ones you are thinking of...  Were you perhaps thinking of 'branches', 'heads', 'tags', 'grep', or 'locate' which I guess could all potentially take this option, but it doesn't seem like such a natural thing as eg incoming and outgoing...)

> Regarding your --template "-" solution: it's cute but you should be
> aware of how slow it potentially is.

Ahhh... Thanks I didn't know this. For background of how I use it see a couple examples:
http://jasonfharris.com/machg/sceenshots/files/collage_lb_image_page6_4_1.png
http://jasonfharris.com/machg/sceenshots/files/collage_lb_image_page6_12_1.png

Its quite neat and my users have commented that they really like it.  Its needed to work well with the espoused philosophy of "use multiple repositories".

> 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.

Thanks. Is there anyway to nicely tell if a bundle is out of date? (Ie when the refresh is done, so I don't just push the problem to repeatedly downloading bundles.)

How hard would it be to make a debugincomingcount, and debugoutgoingcount which are efficient, and would such things be acceptable for inclusion in mercurial proper? Naively I can think of a few ways to do this, but thinking about it, I am guessing there is already a lot of machinery in Mercurial to do such things, as to efficiently finding out when one dag differs from another.

Thanks,
  Jas

> [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