Merge lp:~danny.vanheumen/bzr/bug-498409-bzr-revert-takes-a-branch-lock into lp:bzr/2.0
Proposed by
Danny van Heumen
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Andrew Bennetts | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp:~danny.vanheumen/bzr/bug-498409-bzr-revert-takes-a-branch-lock | ||||
Merge into: | lp:bzr/2.0 | ||||
Diff against target: |
166 lines (+105/-2) 6 files modified
NEWS (+4/-0) bzrlib/builtins.py (+1/-1) bzrlib/lock.py (+1/-1) bzrlib/tests/commands/__init__.py (+1/-0) bzrlib/tests/commands/test_revert.py (+61/-0) doc/developers/testing.txt (+37/-0) |
||||
To merge this branch: | bzr merge lp:~danny.vanheumen/bzr/bug-498409-bzr-revert-takes-a-branch-lock | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ian Clatworthy | Approve | ||
Andrew Bennetts | Approve | ||
Review via email: mp+21000@code.launchpad.net |
Commit message
(andrew, for Danny van Heumen) 'bzr revert' no longer takes a branch lock (#498409)
Description of the change
Fix for bug 498409 bzr revert takes a branch lock including a test.
To post a comment you must log in.
Overall this looks very good, and only needs a few tweaks I think.
Thanks for writing that documentation! I was a bit surprised to see a documentation addition in the diff because you didn't mention it in the merge proposal description, but it was a welcome surprise :)
126 +Note that the representation of LockResult can be confusing. As can be seen in file:// /tmp/testbzr- J2pcy2. tmp/.bzr/ branch/ lockh8c6t28rcjd kgxtndbje) tndbje` , are used internally
127 +the sample below::
128 +
129 + LockResult(
130 +
131 +The last 20 characters, in this case `h8c6t28rcjdkgx
132 +in the locking mechanism. The locking URL is everything before that.
That is confusing. Rather than explain the confusing, I think we should just fix LockResult's __repr__ method so that it doesn't confuse, e.g.:
def __repr__(self): _class_ _.__name_ _, _class_ _.__name_ _,
- return '%s(%s%s)' % (self._
+ return '%s(%s, %s)' % (self._
(in bzrlib/lock.py)
147 +Note: There is one special case of a lock that is created during the creation of file:// /tmp/testbzr- J2pcy2. tmp/.bzr/ branch- lockc4au55ppz8w dym11z1aq)
148 +the '.bzr' directory, for example when a new branch is initialized.
149 +If this is the case, the LockResult will look like this::
150 +
151 + LockResult(
152 +
153 +or `/branch-lock`
I don't think this is a special case, really. I'd just list this as "BzrDir: `/branch-lock`" in your list of lock types.
83 + # make sure that only one lock is acquired and released. acquired) ) released) )
84 + self.assertEqual(1, len(locks_
85 + self.assertEqual(1, len(locks_
Use "self.assertLen gth(1, locks_acquired)" instead; it's a little short and clearer, and will give more informative errors if it fails.
65 + self.start_ logging_ connections( )
I don't think you need to call this, you don't seem to use it. For that matter, I think you should simply use TestCaseInTempDir rather than the more complicated TestCaseWithCon nectionHookedTr ansport.
You should add an entry to NEWS for this fix — you deserve the credit!
Finally, it appears you haven't signed a contributors agreement yet, please follow the instructions at <http:// www.canonical. com/contributor s>.
Thanks!