transaction: tests we don't overwrite bookmark activation on abort stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 22 Feb 2023 18:10:26 +0100
branchstable
changeset 50173 bf27727e6c78
parent 50172 b90899794ced
child 50174 596a6b9b0570
child 50177 964a913343a2
transaction: tests we don't overwrite bookmark activation on abort We actually do not! Great.
tests/test-transaction-wc-rollback-race.t
--- a/tests/test-transaction-wc-rollback-race.t	Wed Feb 22 18:09:12 2023 +0100
+++ b/tests/test-transaction-wc-rollback-race.t	Wed Feb 22 18:10:26 2023 +0100
@@ -211,3 +211,57 @@
 
   $ hg purge --no-confirm
   $ hg up --quiet babar
+
+Activating a bookmark
+---------------------
+(without going through the bookmark command)
+
+Show the activation/desactivation pattern that exist without taking the store
+lock.
+
+  $ hg log -r . -T '= {activebookmark} =\n'
+  =  =
+  $ hg up bar
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (activating bookmark bar)
+  $ hg log -r . -T '= {activebookmark} =\n'
+  = bar =
+  $ hg up .
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (leaving bookmark bar)
+  $ hg log -r . -T '= {activebookmark} =\n'
+  =  =
+
+Activating the bookmark during a transaction
+
+  $ hg up . --quiet
+  $ hg log -r . -T '= {activebookmark} =\n'
+  =  =
+  $ hg phase --public --rev 0 2> ../log.err &
+  $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/transaction-waiting
+  $ hg up bar
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (activating bookmark bar)
+  $ hg log -r . -T '= {activebookmark} =\n'
+  = bar =
+  $ touch $TESTTMP/transaction-continue
+  $ wait
+  $ hg log -r . -T '= {activebookmark} =\n'
+  = bar =
+
+Deactivating the bookmark
+
+  $ hg up bar --quiet
+  $ hg log -r . -T '= {activebookmark} =\n'
+  = bar =
+  $ hg phase --public --rev 0 2> ../log.err &
+  $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/transaction-waiting
+  $ hg up .
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (leaving bookmark bar)
+  $ hg log -r . -T '= {activebookmark} =\n'
+  =  =
+  $ touch $TESTTMP/transaction-continue
+  $ wait
+  $ hg log -r . -T '= {activebookmark} =\n'
+  =  =