/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 brzlib/smart/packrepository.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 12:41:27 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521124127-iv8etg0vwymyai6y
s/bzr/brz/ in apport config.

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
 
17
19
"""Server-side pack repository related request implmentations."""
18
20
 
19
 
from .request import (
 
21
from brzlib.smart.request import (
 
22
    FailedSmartServerResponse,
20
23
    SuccessfulSmartServerResponse,
21
24
    )
22
25
 
23
26
 
24
 
from .repository import (
 
27
from brzlib.smart.repository import (
25
28
    SmartServerRepositoryRequest,
26
29
    )
27
30
 
33
36
        if pack_collection is None:
34
37
            # This is a not a pack repo, so asking for an autopack is just a
35
38
            # no-op.
36
 
            return SuccessfulSmartServerResponse((b'ok',))
37
 
        with repository.lock_write():
 
39
            return SuccessfulSmartServerResponse(('ok',))
 
40
        repository.lock_write()
 
41
        try:
38
42
            repository._pack_collection.autopack()
39
 
        return SuccessfulSmartServerResponse((b'ok',))
 
43
        finally:
 
44
            repository.unlock()
 
45
        return SuccessfulSmartServerResponse(('ok',))
 
46
 
 
47