/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/smart/packrepository.py

  • Committer: Marius Kruger
  • Date: 2010-07-10 21:28:56 UTC
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100710212856-uq4ji3go0u5se7hx
* Update documentation
* add NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
"""Server-side pack repository related request implmentations."""
20
18
 
21
 
from .request import (
 
19
from bzrlib.smart.request import (
 
20
    FailedSmartServerResponse,
22
21
    SuccessfulSmartServerResponse,
23
22
    )
24
23
 
25
24
 
26
 
from .repository import (
 
25
from bzrlib.smart.repository import (
27
26
    SmartServerRepositoryRequest,
28
27
    )
29
28
 
35
34
        if pack_collection is None:
36
35
            # This is a not a pack repo, so asking for an autopack is just a
37
36
            # no-op.
38
 
            return SuccessfulSmartServerResponse((b'ok',))
39
 
        with repository.lock_write():
 
37
            return SuccessfulSmartServerResponse(('ok',))
 
38
        repository.lock_write()
 
39
        try:
40
40
            repository._pack_collection.autopack()
41
 
        return SuccessfulSmartServerResponse((b'ok',))
 
41
        finally:
 
42
            repository.unlock()
 
43
        return SuccessfulSmartServerResponse(('ok',))
 
44
 
 
45