Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 20237:0d32dd60016c
bisect: --command without --noupdate should flag the parent rev it tested
14913fcb30c6 not only introduced the 'bisect(current)' revset predicate, it
also changed how the 'current' revision is used in combination with --command.
The new behaviour might be ok for --noupdate where the working directory and
its revision shouldn't be used, but it also did that when --command is used to
run a command on the currently checked out revision then it could register the
test result on the wrong revision.
An example:
Before, bisect with --command could use the wrong revision when recording the
test result:
$ hg up -qr 0
$ hg bisect --command "python \"$TESTTMP/script.py\" and some parameters"
changeset 31:58c80a7c8a40: bad
abort: inconsistent state, 31:58c80a7c8a40 is good and bad
Now it works as before and as expected and uses the working directory revision
for the --command result:
$ hg up -qr 0
$ hg bisect --command "python \"$TESTTMP/script.py\" and some parameters"
changeset 0:b99c7b9c8e11: bad
...
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Sat, 16 Nov 2013 15:46:29 -0500 |
parents | a602d2aca8bf |
children | 2123d27ff75d |
line wrap: on
line diff
--- a/mercurial/commands.py Sat Nov 16 15:46:29 2013 -0500 +++ b/mercurial/commands.py Sat Nov 16 15:46:29 2013 -0500 @@ -667,12 +667,13 @@ if command: changesets = 1 - try: - node = state['current'][0] - except LookupError: - if noupdate: + if noupdate: + try: + node = state['current'][0] + except LookupError: raise util.Abort(_('current bisect revision is unknown - ' 'start a new bisect to fix')) + else: node, p2 = repo.dirstate.parents() if p2 != nullid: raise util.Abort(_('current bisect revision is a merge'))