[Bug 5696] New: hg incoming exit status is ambiguous

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Mon Oct 2 00:54:22 UTC 2017


https://bz.mercurial-scm.org/show_bug.cgi?id=5696

            Bug ID: 5696
           Summary: hg incoming exit status is ambiguous
           Product: Mercurial
           Version: 4.3
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: vincent at vinc17.net
                CC: mercurial-devel at mercurial-scm.org

The description of the exit status of "hg incoming" is:

  Returns 0 if there are incoming changes, 1 otherwise.

But this is ambiguous. It does not say what happens in case the server is
unreachable. This prevents one from writing robust scripts.

Actually, hg doesn't behave as documented:

zira% hg incoming foo
abort: repository foo not found!
zira% echo $?
255

while 255 isn't a documented exit status. And an exit status larger than 128
may not be a good idea because this generally means that the command received a
signal.

Note that "diff" and "grep" also differentiate the status by returning 0 or 1,
but return 2 in case of error.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list