607 > # If anything to commit, commit it right after the first key listing used |
607 > # If anything to commit, commit it right after the first key listing used |
608 > # during lookup. This makes the commit appear before the actual getbundle |
608 > # during lookup. This makes the commit appear before the actual getbundle |
609 > # call. |
609 > # call. |
610 > listkeys.makecommit= sh $TESTTMP/listkeys_makecommit.sh |
610 > listkeys.makecommit= sh $TESTTMP/listkeys_makecommit.sh |
611 > EOF |
611 > EOF |
612 |
612 $ restart_server() { |
613 (new config need server restart) |
613 > "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
614 |
614 > hg serve -R ../pull-race -p $HGPORT -d --pid-file=../pull-race.pid -E main-error.log |
615 $ killdaemons.py |
615 > cat ../pull-race.pid >> $DAEMON_PIDS |
616 $ hg serve -R ../pull-race -p $HGPORT -d --pid-file=../pull-race.pid -E main-error.log |
616 > } |
617 $ cat ../pull-race.pid >> $DAEMON_PIDS |
617 $ restart_server # new config need server restart |
618 |
|
619 $ hg -R $TESTTMP/pull-race book |
618 $ hg -R $TESTTMP/pull-race book |
620 @ 1:0d2164f0ce0d |
619 @ 1:0d2164f0ce0d |
621 X 1:0d2164f0ce0d |
620 X 1:0d2164f0ce0d |
622 * Y 5:35d1ef0a8d1b |
621 * Y 5:35d1ef0a8d1b |
623 Z 1:0d2164f0ce0d |
622 Z 1:0d2164f0ce0d |
636 (run 'hg update' to get a working copy) |
635 (run 'hg update' to get a working copy) |
637 $ hg book |
636 $ hg book |
638 @ 1:0d2164f0ce0d |
637 @ 1:0d2164f0ce0d |
639 X 1:0d2164f0ce0d |
638 X 1:0d2164f0ce0d |
640 * Y 5:35d1ef0a8d1b |
639 * Y 5:35d1ef0a8d1b |
|
640 Z 1:0d2164f0ce0d |
|
641 |
|
642 Update a bookmark right after the initial lookup -r (issue4700) |
|
643 |
|
644 $ echo c7 > ../pull-race/f3 # to be committed during the race |
|
645 $ cat <<EOF > ../lookuphook.py |
|
646 > """small extensions adding a hook after wireprotocol lookup to test race""" |
|
647 > import functools |
|
648 > from mercurial import wireprotov1server, wireprotov2server |
|
649 > |
|
650 > def wrappedlookup(orig, repo, *args, **kwargs): |
|
651 > ret = orig(repo, *args, **kwargs) |
|
652 > repo.hook(b'lookup') |
|
653 > return ret |
|
654 > for table in [wireprotov1server.commands, wireprotov2server.COMMANDS]: |
|
655 > table[b'lookup'].func = functools.partial(wrappedlookup, table[b'lookup'].func) |
|
656 > EOF |
|
657 $ cat <<EOF > ../pull-race/.hg/hgrc |
|
658 > [extensions] |
|
659 > lookuphook=$TESTTMP/lookuphook.py |
|
660 > [hooks] |
|
661 > lookup.makecommit= sh $TESTTMP/listkeys_makecommit.sh |
|
662 > EOF |
|
663 $ restart_server # new config need server restart |
|
664 $ hg -R $TESTTMP/pull-race book |
|
665 @ 1:0d2164f0ce0d |
|
666 X 1:0d2164f0ce0d |
|
667 * Y 6:0d60821d2197 |
|
668 Z 1:0d2164f0ce0d |
|
669 $ hg pull -r Y |
|
670 pulling from http://localhost:$HGPORT/ |
|
671 searching for changes |
|
672 adding changesets |
|
673 adding manifests |
|
674 adding file changes |
|
675 added 1 changesets with 1 changes to 1 files |
|
676 new changesets 0d60821d2197 (1 drafts) |
|
677 (run 'hg update' to get a working copy) |
|
678 $ hg book |
|
679 @ 1:0d2164f0ce0d |
|
680 X 1:0d2164f0ce0d |
|
681 * Y 5:35d1ef0a8d1b |
|
682 Z 1:0d2164f0ce0d |
|
683 $ hg -R $TESTTMP/pull-race book |
|
684 @ 1:0d2164f0ce0d |
|
685 X 1:0d2164f0ce0d |
|
686 * Y 7:714424d9e8b8 |
641 Z 1:0d2164f0ce0d |
687 Z 1:0d2164f0ce0d |
642 |
688 |
643 (done with this section of the test) |
689 (done with this section of the test) |
644 |
690 |
645 $ killdaemons.py |
691 $ killdaemons.py |