unshelving new file fails if its directory has been committed since shelving
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
High
|
Unassigned | ||
Breezy |
Triaged
|
Medium
|
Unassigned |
Bug Description
If I create new files in new subdirectories, and then want to commit the changes to the directory structure separately from the changes to the actual files, by shelving the files, committing the added directories, and then unshelving the new files to commit, bzr raises an exception, leaving the new files inaccessible on the shelf.
Minimal steps to reproduce:
# in a clean working directory
mkdir dir/
echo "this line represents editing" >> dir/file
bzr add
bzr shelve -m "work on file" dir/file
# Shelve adding file "dir/file"? [yNfq?] y
# Shelve adding file "dir"? [yNfq?] n
# Selected changes:
# -D dir/file
# Shelve 1 change(s)? [yNfq?] y
bzr ci -m "setup dir"
bzr unshelve
Expected outcome: the new file is unshelved successfully.
Actual outcome:
Using changes with id "1".
Message: work on file
bzr: ERROR: No final name for trans_id 'new-2'
file-id: 'dir-2011091503
root trans-id: 'new-0'
For my current situation (a number of files stuck in shelf purgatory, impeding work progress):
* Is it somehow possible to get back the shelved changes within the facilities of bzr (e.g. unwinding the add, commit and shelve), or will I have to resort to manually fiddling them out of .bzr/checkout/
* If I do manually recreate the files, do I have to keep anything in mind to avoid corrupting the repository?
* How do I then get rid of the broken shelf?
For the future, what is the recommended workflow to get new files committed separately from their directories?
tags: | added: check-for-breezy |
I'm using 6.32-33- generic- i686-with- Ubuntu- 10.04-lucid
Bazaar: version 2.4.0
Python: version 2.6.5
Platform: Linux-2.
Here's the traceback from the Bazaar log file:
modules/ python2. 6/bzrlib/ cleanup. py", line 165, in _do_with_cleanups pymodules/ python2. 6/bzrlib/ builtins. py", line 6138, in run pymodules/ python2. 6/bzrlib/ shelf_ui. py", line 479, in run make_merger( None) pymodules/ python2. 6/bzrlib/ shelf.py" , line 332, in make_merger get_preview_ tree() pymodules/ python2. 6/bzrlib/ transform. py", line 1022, in get_preview_tree pymodules/ python2. 6/bzrlib/ transform. py", line 1997, in __init__ _transform. iter_changes( )) pymodules/ python2. 6/bzrlib/ transform. py", line 997, in iter_changes get_path( to_trans_ id) pymodules/ python2. 6/bzrlib/ transform. py", line 2473, in get_path _known_ paths[trans_ id] = self._determine _path(trans_ id) pymodules/ python2. 6/bzrlib/ transform. py", line 2468, in _determine_path self.get_ path(parent_ id), name) pymodules/ python2. 6/bzrlib/ transform. py", line 2473, in get_path _known_ paths[trans_ id] = self._determine _path(trans_ id) pymodules/ python2. 6/bzrlib/ transform. py", line 2463, in _determine_path final_name( trans_id) pymodules/ python2. 6/bzrlib/ transform. py", line 509, in final_name trans_id, self) 0501-qxj7l1zjc3 xx5tq7- 1'
result = func(*args, **kwargs)
File "/usr/lib/
unshelver.run()
File "/usr/lib/
merger = unshelver.
File "/usr/lib/
target_tree = self.transform.
File "/usr/lib/
return _PreviewTree(self)
File "/usr/lib/
self.
File "/usr/lib/
to_path = final_paths.
File "/usr/lib/
self.
File "/usr/lib/
return pathjoin(
File "/usr/lib/
self.
File "/usr/lib/
name = self.transform.
File "/usr/lib/
raise NoFinalPath(
NoFinalPath: No final name for trans_id 'new-2'
file-id: 'dir-2011091503
root trans-id: 'new-0'