# HG changeset patch
# User Mitsuhiro Koga <shiena.jp@gmail.com>
# Date 1353556609 -32400
# Node ID b303b60be11e9c02fe798bf19a181b1e6216f694
# Parent  6315bdd1546e4e66ce25c68f23d44acebee747db
wrappers: Return the same value as the original incoming command

diff --git a/hgsubversion/wrappers.py b/hgsubversion/wrappers.py
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -101,6 +101,11 @@ def incoming(orig, ui, repo, origsource=
     svnrevisions = list(svn.revisions(start=meta.revmap.youngest))
     if opts.get('newest_first'):
         svnrevisions.reverse()
+    # Returns 0 if there are incoming changes, 1 otherwise.
+    if len(svnrevisions) > 0:
+        ret = 0
+    else:
+        ret = 1
     for r in svnrevisions:
         ui.status('\n')
         for label, attr in revmeta:
@@ -109,6 +114,7 @@ def incoming(orig, ui, repo, origsource=
             if not ui.verbose:
                 val = val.split('\n')[0]
             ui.status('%s%s\n' % (l1.ljust(13), val))
+    return ret
 
 
 def findcommonoutgoing(repo, other, onlyheads=None, force=False, commoninc=None):