Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 13107:3bc237b0eaea
subrepo: treat git error code 1 as success
At least status, commit, merge-base, and diff all return 1 when not failing.
author | Eric Eisner <ede@mit.edu> |
---|---|
date | Thu, 09 Dec 2010 16:52:14 -0500 |
parents | c869bd9e1193 |
children | dcaad69cfd6a |
comparison
equal
deleted
inserted
replaced
13106:c869bd9e1193 | 13107:3bc237b0eaea |
---|---|
639 | 639 |
640 retdata = p.stdout.read().strip() | 640 retdata = p.stdout.read().strip() |
641 # wait for the child to exit to avoid race condition. | 641 # wait for the child to exit to avoid race condition. |
642 p.wait() | 642 p.wait() |
643 | 643 |
644 if p.returncode != 0: | 644 if p.returncode != 0 and p.returncode != 1: |
645 # there are certain error codes that are ok | 645 # there are certain error codes that are ok |
646 command = None | 646 command = None |
647 for arg in commands: | 647 for arg in commands: |
648 if not arg.startswith('-'): | 648 if not arg.startswith('-'): |
649 command = arg | 649 command = arg |
650 break | 650 break |
651 if command == 'cat-file': | 651 if command == 'cat-file': |
652 return retdata, p.returncode | |
653 if command in ('commit', 'status') and p.returncode == 1: | |
654 return retdata, p.returncode | 652 return retdata, p.returncode |
655 # for all others, abort | 653 # for all others, abort |
656 raise util.Abort('git %s error %d' % (command, p.returncode)) | 654 raise util.Abort('git %s error %d' % (command, p.returncode)) |
657 | 655 |
658 return retdata, p.returncode | 656 return retdata, p.returncode |