UnlockableTransport error trying to commit in checkout of readonly branch
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Martin Pool |
Bug Description
If a developer has checked out a branch (rather than having branched it), and then attempts to make a commit to that branch, the error message is two screenfulls of Python gibberish:
"""
bzr: ERROR: bzrlib.
Traceback (most recent call last):
File "/usr/lib/
return run_bzr(argv)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/usr/lib/
reporter=
File "/usr/lib/
return unbound(self, *args, **kwargs)
File "/usr/lib/
result = WorkingTree3.
File "/usr/lib/
return unbound(self, *args, **kwargs)
File "/usr/lib/
revprops=
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
repo_token = self.repository
File "/usr/lib/
return self.control_
File "/usr/lib/
token_from_lock = self._lock.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
raise UnlockableTrans
UnlockableTrans
bzr 0.17.0 on python 2.4.4.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'commit', 'README']
"""
Instead of all that nonsense, it might be more helpful to output a usable (and, for that matter, translatable) message indicating what the problem actually is and what to do about it. Perhaps:
"""
Error: this is a checkout, so you can't commit here. What you want to do is create your own full power branch to which you can make changes, make as many commits as you like, and then submit your code to the upstream project using bzr bundle. To make a branch (assuming you're in a directory called mainline which is what you checked out), just do
cd ..
bzr branch mainline working
cd working
And you're all set. That way you can keep using the ../mainline directory as a branch where you can do bzr pull to track the upstream project, and this new full powered branch as your playground
"""
However, going even further, since the result of checkout and branch differ by _only_ by:
bound = True
perhaps the right thing to actually do is to deprecate the whole checkout thing and just make it a synonym of branch like clone is. After all, if upstream has diverged, big deal - they have to merge and better that they resolve any conflicts rather than the poor upstream maintained having to.
AfC
Changed in bzr: | |
importance: | Undecided → Medium |
Changed in bzr: | |
assignee: | nobody → mbp |
Changed in bzr: | |
status: | Confirmed → In Progress |
Changed in bzr: | |
milestone: | none → 0.92 |
status: | Fix Committed → Fix Released |
I've just encountered this one too. Confirming.