[PATCH 1 of 5 V2] bundle2: lock the repo during unbundle test

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Fri Apr 4 13:11:48 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1396571147 25200
#      Thu Apr 03 17:25:47 2014 -0700
# Node ID d29c0c3a452740d01afe2aaa9a93da293ebbf705
# Parent  d3775db748a06450b69e4fd5beb52cb5e9ef07b0
bundle2: lock the repo during unbundle test

We forgot the lock the repo. It's not too bad during tests, but the lock also
still carry some transaction logic. (yes we need to get ride of this)

diff --git a/tests/test-bundle2.t b/tests/test-bundle2.t
--- a/tests/test-bundle2.t
+++ b/tests/test-bundle2.t
@@ -70,15 +70,17 @@ Create an extension to test bundle2 API
   > 
   > @command('unbundle2', [], '')
   > def cmdunbundle2(ui, repo):
   >     """process a bundle2 stream from stdin on the current repo"""
   >     try:
+  >         lock = repo.lock()
   >         try:
   >             bundle2.processbundle(repo, sys.stdin)
   >         except KeyError, exc:
   >             raise util.Abort('missing support for %s' % exc)
   >     finally:
+  >         lock.release()
   >         remains = sys.stdin.read()
   >         ui.write('%i unread bytes\n' % len(remains))
   > 
   > @command('statbundle2', [], '')
   > def cmdstatbundle2(ui, repo):


More information about the Mercurial-devel mailing list