Mercurial > public > mercurial-scm > hg-stable
diff hgext/fetch.py @ 12711:b885f28fa4fa
fetch: fix and document exit codes (issue2356)
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 11 Oct 2010 14:39:13 -0500 |
parents | 40c06bbf58be |
children | 924c82157d46 |
line wrap: on
line diff
--- a/hgext/fetch.py Sun Oct 10 23:32:09 2010 +0200 +++ b/hgext/fetch.py Mon Oct 11 14:39:13 2010 -0500 @@ -29,6 +29,8 @@ order, use --switch-parent. See :hg:`help dates` for a list of formats valid for -d/--date. + + Returns 0 on success. ''' date = opts.get('date') @@ -86,7 +88,7 @@ if newchildren[0] != parent: return hg.clean(repo, newchildren[0]) else: - return + return 0 # Are there more than one additional branch heads? newchildren = [n for n in newchildren if n != parent] @@ -99,7 +101,7 @@ ui.status(_('not merging with %d other new branch heads ' '(use "hg heads ." and "hg merge" to merge them)\n') % (len(newheads) - 1)) - return + return 1 # Otherwise, let's merge. err = False @@ -132,6 +134,8 @@ 'with local\n') % (repo.changelog.rev(n), short(n))) + return err + finally: release(lock, wlock)