~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/repository.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-12 13:44:20 UTC
  • mfrom: (6358 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6362.
  • Revision ID: jelmer@samba.org-20111212134420-20130h4aa5ewp2m7
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1101
1101
        return SuccessfulSmartServerResponse(("ok", ), "\n".join(revids))
1102
1102
 
1103
1103
 
 
1104
class SmartServerRepositoryReconcile(SmartServerRepositoryRequest):
 
1105
    """Reconcile a repository.
 
1106
 
 
1107
    New in 2.5.
 
1108
    """
 
1109
 
 
1110
    def do_repository_request(self, repository, lock_token):
 
1111
        try:
 
1112
            repository.lock_write(token=lock_token)
 
1113
        except errors.TokenLockingNotSupported, e:
 
1114
            return FailedSmartServerResponse(
 
1115
                ('TokenLockingNotSupported', ))
 
1116
        try:
 
1117
            reconciler = repository.reconcile()
 
1118
        finally:
 
1119
            repository.unlock()
 
1120
        body = [
 
1121
            "garbage_inventories: %d\n" % reconciler.garbage_inventories,
 
1122
            "inconsistent_parents: %d\n" % reconciler.inconsistent_parents,
 
1123
            ]
 
1124
        return SuccessfulSmartServerResponse(('ok', ), "".join(body))
 
1125
 
 
1126
 
1104
1127
class SmartServerRepositoryPack(SmartServerRepositoryRequest):
1105
1128
    """Pack a repository.
1106
1129