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

login
register
mail settings
Submitter Pierre-Yves David
Date April 4, 2014, 6:11 p.m.
Message ID <d29c0c3a452740d01afe.1396635108@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4225/
State Accepted
Commit e910336539f744e719c2d9524316a53653f1525d
Headers show

Comments

Pierre-Yves David - April 4, 2014, 6:11 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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)

Patch

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):