Test updating multiple refs in a single transaction.
(testrepo: Repository)
| 68 | |
| 69 | |
| 70 | def test_transaction_multiple_refs(testrepo: Repository) -> None: |
| 71 | """Test updating multiple refs in a single transaction.""" |
| 72 | master_ref = testrepo.lookup_reference('refs/heads/master') |
| 73 | i18n_ref = testrepo.lookup_reference('refs/heads/i18n') |
| 74 | |
| 75 | new_master = Oid(hex='5ebeeebb320790caf276b9fc8b24546d63316533') |
| 76 | new_i18n = Oid(hex='2be5719152d4f82c7302b1c0932d8e5f0a4a0e98') |
| 77 | |
| 78 | with testrepo.transaction() as txn: |
| 79 | txn.lock_ref('refs/heads/master') |
| 80 | txn.lock_ref('refs/heads/i18n') |
| 81 | txn.set_target('refs/heads/master', new_master, message='Update master') |
| 82 | txn.set_target('refs/heads/i18n', new_i18n, message='Update i18n') |
| 83 | |
| 84 | # Verify both updates were applied |
| 85 | master_ref = testrepo.lookup_reference('refs/heads/master') |
| 86 | i18n_ref = testrepo.lookup_reference('refs/heads/i18n') |
| 87 | assert master_ref.target == new_master |
| 88 | assert i18n_ref.target == new_i18n |
| 89 | |
| 90 | |
| 91 | def test_transaction_symbolic_ref(testrepo: Repository) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…