changeset 21049:f117a0ba5289

hg: make "_outgoing()" return empty list instead of "None" This patch makes "_outgoing()" return empty list instead of "None", if there are no outgoing changesets, because: - returning "None" requires callers to examine whether returned value is "None" or not explicitly, if callers want to execute loop on returned value, but - there are no explicit needs to return "None"
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 16 Apr 2014 00:37:24 +0900
parents ca7a57464fb3
children 025ec0f08cb6
files mercurial/commands.py mercurial/hg.py
diffstat 2 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Apr 16 00:37:24 2014 +0900
+++ b/mercurial/commands.py	Wed Apr 16 00:37:24 2014 +0900
@@ -4354,7 +4354,7 @@
     if opts.get('graph'):
         cmdutil.checkunsupportedgraphflags([], opts)
         o = hg._outgoing(ui, repo, dest, opts)
-        if o is None:
+        if not o:
             return
 
         revdag = cmdutil.graphrevs(repo, o, opts)
--- a/mercurial/hg.py	Wed Apr 16 00:37:24 2014 +0900
+++ b/mercurial/hg.py	Wed Apr 16 00:37:24 2014 +0900
@@ -585,7 +585,6 @@
     o = outgoing.missing
     if not o:
         scmutil.nochangesfound(repo.ui, repo, outgoing.excluded)
-        return None
     return o
 
 def outgoing(ui, repo, dest, opts):
@@ -600,7 +599,7 @@
 
     limit = cmdutil.loglimit(opts)
     o = _outgoing(ui, repo, dest, opts)
-    if o is None:
+    if not o:
         return recurse()
 
     if opts.get('newest_first'):