Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 16648:1388cc711ea7
bisect: set HG_NODE when runing a command
When running a command, set the environment variable HG_NODE to
tell the command which changeset is being visited.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Tue, 08 May 2012 15:31:00 -0700 |
parents | 14913fcb30c6 |
children | b6081c2c4647 |
comparison
equal
deleted
inserted
replaced
16647:14913fcb30c6 | 16648:1388cc711ea7 |
---|---|
518 | 518 |
519 As a shortcut, you can also use the revision argument to mark a | 519 As a shortcut, you can also use the revision argument to mark a |
520 revision as good or bad without checking it out first. | 520 revision as good or bad without checking it out first. |
521 | 521 |
522 If you supply a command, it will be used for automatic bisection. | 522 If you supply a command, it will be used for automatic bisection. |
523 Its exit status will be used to mark revisions as good or bad: | 523 The environment variable HG_NODE will contain the ID of the |
524 status 0 means good, 125 means to skip the revision, 127 | 524 changeset being tested. The exit status of the command will be |
525 (command not found) will abort the bisection, and any other | 525 used to mark revisions as good or bad: status 0 means good, 125 |
526 non-zero exit status means the revision is bad. | 526 means to skip the revision, 127 (command not found) will abort the |
527 bisection, and any other non-zero exit status means the revision | |
528 is bad. | |
527 | 529 |
528 .. container:: verbose | 530 .. container:: verbose |
529 | 531 |
530 Some examples: | 532 Some examples: |
531 | 533 |
663 try: | 665 try: |
664 while changesets: | 666 while changesets: |
665 # update state | 667 # update state |
666 state['current'] = [node] | 668 state['current'] = [node] |
667 hbisect.save_state(repo, state) | 669 hbisect.save_state(repo, state) |
668 status = util.system(command, out=ui.fout) | 670 status = util.system(command, |
671 environ={'HG_NODE': hex(node)}, | |
672 out=ui.fout) | |
669 if status == 125: | 673 if status == 125: |
670 transition = "skip" | 674 transition = "skip" |
671 elif status == 0: | 675 elif status == 0: |
672 transition = "good" | 676 transition = "good" |
673 # status < 0 means process was killed | 677 # status < 0 means process was killed |