Please, some "partial-silency" option for pull

Greg Ward gerg.ward+hg at gmail.com
Tue Dec 2 19:45:17 UTC 2008


On 01 December 2008, Marcin Kasperski said:
> It would be nice if hg pull could be configured to suppress output
> when there are no changes transferred.
[...]
> Syntax suggestion:
> 
>    hg pull --silent

Good idea, bad option name.  In my experience, --silent is quieter
than --quiet when a program has both options.  Informally, I think
--quiet is generally understood to mean "no unnecessary output" while
--silent means "absolutely no output except for errors".

Sounds like "hg -q pull" uses the latter interpretation, i.e.
"absolutely no output except for errors".  So adding a --silent option
would be a bad idea, IMHO.

Another idea that does not require changing Mercurial: use 
"hg incoming" to find out if there is anything to pull.  
E.g.:

  for repo in ...; do
    cd $repo
    hg -q incoming --bundle <tmpfile> > /dev/null
    [ -f <tmpfile> ] && hg unbundle <tmpfile> 
    rm -f <tmpfile>
  done

Note that unbundle prints a list of changeset IDs to stdout even with
-q, so I discarded its output.  And make it write a bundle so you
don't need to download the changes twice.

Completely untested, YMMV, etc.

       Greg



More information about the Mercurial mailing list