[PATCH] identify: don't print a newline with no output

Matt Mackall mpm at selenic.com
Mon Apr 18 20:46:35 CDT 2011


On Tue, 2011-04-19 at 00:44 +0300, Idan Kamara wrote:
> # HG changeset patch
> # User Idan Kamara <idankk86 at gmail.com>
> # Date 1303163022 -10800
> # Node ID 87c8ba7850a21ef098f8674e2ea70849da6e1ba3
> # Parent  2700824843a400695d6bcaa7360c58046b65a264
> identify: don't print a newline with no output
> 
> diff -r 2700824843a4 -r 87c8ba7850a2 mercurial/commands.py
> --- a/mercurial/commands.py	Tue Apr 19 00:41:47 2011 +0300
> +++ b/mercurial/commands.py	Tue Apr 19 00:43:42 2011 +0300
> @@ -2436,7 +2436,8 @@
>      if bookmarks:
>          output.extend(bms)
>  
> -    ui.write("%s\n" % ' '.join(output))
> +    if output:
> +        ui.write("%s\n" % ' '.join(output))

While this is prettier, it might surprise stupid parsers.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list