Merge lp:~jameinel/bzr/1.16-abort-resume-aborts-start into lp:~bzr/bzr/trunk-old

Proposed by John A Meinel on 2009-06-01
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jameinel/bzr/1.16-abort-resume-aborts-start
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 15 lines
To merge this branch: bzr merge lp:~jameinel/bzr/1.16-abort-resume-aborts-start
Reviewer Review Type Date Requested Status
Andrew Bennetts 2009-06-01 Approve on 2009-06-05
Review via email: mp+6949@code.launchpad.net
To post a comment you must log in.
John A Meinel (jameinel) wrote :

This gives a cleaner test suite run on Windows.

Basically, Repository.resume_write_group() internally _starts_write_group() and then resumes the given tokens.

However, tokens can fail to be resumed, which leaves things in an intermediate state. Namely, the _start_write_group finished, but wasn't aborted. Which leaves open the NewPack.

I don't know if this ever matters in practice, but at least on Windows it causes
    def test_cannot_resume_aborted_write_group(self):

To give cleanup stipple because we can't cleanup the working dir because of the open file handle.

4397. By John A Meinel on 2009-06-01

Fixed the TODO

Andrew Bennetts (spiv) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/repofmt/pack_repo.py'
2--- bzrlib/repofmt/pack_repo.py 2009-06-03 21:28:52 +0000
3+++ bzrlib/repofmt/pack_repo.py 2009-06-05 02:36:05 +0000
4@@ -2289,7 +2289,11 @@
5
6 def _resume_write_group(self, tokens):
7 self._start_write_group()
8- self._pack_collection._resume_write_group(tokens)
9+ try:
10+ self._pack_collection._resume_write_group(tokens)
11+ except errors.UnresumableWriteGroup:
12+ self._abort_write_group()
13+ raise
14 for pack in self._pack_collection._resumed_packs:
15 self.revisions._index.scan_unvalidated_index(pack.revision_index)
16