dirstate: use wlock and changing_files context in `test-revlog-ancestry`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 25 Jan 2023 12:57:52 +0100
changeset 50095 7b289a70c2c8
parent 50094 6cdcab3ae3fa
child 50096 d41960df197e
dirstate: use wlock and changing_files context in `test-revlog-ancestry` This is the way.
tests/test-revlog-ancestry.py
--- a/tests/test-revlog-ancestry.py	Tue Dec 13 15:01:59 2022 +0100
+++ b/tests/test-revlog-ancestry.py	Wed Jan 25 12:57:52 2023 +0100
@@ -19,8 +19,10 @@
     f = open(name, 'wb')
     f.write(b'%s\n' % name)
     f.close()
-    repo[None].add([name])
-    commit(name, time)
+    with repo.wlock():
+        with repo.dirstate.changing_files(repo):
+            repo[None].add([name])
+        commit(name, time)
 
 
 def update(rev):